Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Track application restart generations #2564
base: stable-6.0
Are you sure you want to change the base?
Track application restart generations #2564
Changes from 9 commits
20df215
744c2b2
b5dd97a
df6f2ac
38187b2
a376e8e
824166d
60d254b
6b739f3
fd21774
c0d99a6
f8481e1
6ab1b52
fc86370
ee8e35c
cec7638
a45c981
8cff85c
b40c7d2
506dccd
04fb08b
dec5f73
6de82a7
3b0605a
815e8e3
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My head is clearer today and I thought of a problem with the routing algorithm. Recall that the algorithm has now turned into essentially this:
This means that during a restart, new requests are only routed to next-generation processes, while previous-generation processes are only allowed to finish their existing requests. That's pretty bad.
I suggest a two-phase routing algorithm:
isTotallyBusy()
, then we fallback to the old algorithm where we select the least busy process amongst all generations. This way we won't waste the old processes.What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes more sense to me than the last algorithm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also since we know we're going to punt if the process
isTotallyBusy()
there's no need to loop twice, just reject ifisTotallyBusy()
is true as we iterate.It does raise another question though, what do we do if all processes are totally busy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pushed a possible solution. I keep track of the best process which is totally busy, until I find one that is not totally busy, at the end of the loop I return either the best process which is not totally busy or if all processes are totally busy, then the best totally busy process.
The mechanism for choosing which process is best is decided as above for both processes, but tracked separately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test is incomplete.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know, I asked for help with this one.