Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set keep-alive to 0 for rocket and make the randomizer output unique numbers from a shuffled array #5296

Merged
merged 1 commit into from
Dec 16, 2019

Conversation

vegai
Copy link
Contributor

@vegai vegai commented Dec 12, 2019

Rocket devs in rwf2/Rocket#1038 suggest that the default keep-alive -setting might cause problems for Rocket.

@vegai
Copy link
Contributor Author

vegai commented Dec 12, 2019

` FAIL for http://tfb-server:8000/updates?q=20

 Only 10106 rows updated in the database out of roughly 10240 expected.`

on the Rocket test. I guess this wasn't so simple after all :) Everything else passed though, so this is slightly weird.

@vegai vegai closed this Dec 12, 2019
@vegai vegai reopened this Dec 12, 2019
@vegai
Copy link
Contributor Author

vegai commented Dec 12, 2019

So I closed/reopened the PR to trigger a Travis rebuild and the 2nd one passed. Slightly weird.

@NateBrady23
Copy link
Member

@vegai it's not consistent. I reran and it failed again. You may need to make sure that the random number you generate is unique, a solution that some of the Java frameworks use.

@vegai
Copy link
Contributor Author

vegai commented Dec 13, 2019

I merely changed the keep-alive -setting though. Do you think that the Rocket test was broken also before this change and something else needs to change to stabilize it? Or that the keep-alive change alone made it unstable?

@NateBrady23
Copy link
Member

It was probably failing verification before this when we added stricter verification testing to the toolset. Probably not a result of your changes but we don’t want to merge broken tests. You could remove that single test to get this merged or if you want to take a shot at fixing it.

@vegai
Copy link
Contributor Author

vegai commented Dec 13, 2019

I can give it a shot. I see that

fn random_number() -> i32 {
    rand::thread_rng().gen_range(1, 10_001)
}

You mean this test fails if the same number is generated more than once here? I guess it would be against the rules to just pick sequential numbers? :)

@NateBrady23
Copy link
Member

Haha, yeah no sequential numbers. My guess, from seeing it happen with a couple of other frameworks, is that there is some caching mechanism somewhere that stops a request from hitting the database if it's a number it has already seen.

@vegai vegai closed this Dec 14, 2019
@vegai vegai reopened this Dec 14, 2019
@vegai vegai force-pushed the master branch 2 times, most recently from 7f2609a to 3b9d10c Compare December 15, 2019 10:05
rustfmt and random numbers from a shuffled vector
@vegai vegai changed the title Set keep-alive to 0 for Rust/Rocket Set keep-alive to 0 for rocket and make the randomizer sequential Dec 15, 2019
@vegai
Copy link
Contributor Author

vegai commented Dec 15, 2019

Seems to have worked now several times. Hopefully I didn't crap on rocket's performance by my code too badly.

@vegai vegai changed the title Set keep-alive to 0 for rocket and make the randomizer sequential Set keep-alive to 0 for rocket and make the randomizer output unique numbers from a shuffled array Dec 15, 2019
@NateBrady23 NateBrady23 merged commit 232d006 into TechEmpower:master Dec 16, 2019
@fraunos
Copy link

fraunos commented Jan 19, 2020

@vegai thanks for your input - I'd love to see how rockey performs, can't wait for another round

tomciopp pushed a commit to tomciopp/FrameworkBenchmarks that referenced this pull request Oct 21, 2020
rustfmt and random numbers from a shuffled vector
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants