Open
Conversation
austin-zhu
reviewed
Aug 21, 2020
| end | ||
| end | ||
|
|
||
| @task_scheduler.kill |
Contributor
There was a problem hiding this comment.
is this kill async or not?
Contributor
Author
There was a problem hiding this comment.
I believe it is async from the docs
Begin an immediate shutdown. In-progress tasks will be allowed to complete but enqueued tasks will be dismissed and no new tasks will be accepted. Has no additional effect if the thread pool is not running.
Contributor
|
LGTM, can we add a test to verify the behavior when on_session_expired is actually invoked? I do not seem to find one in current rspec. |
Contributor
Author
I added those tests now @gmcatsf |
Contributor
|
There are conflicts with current master please resolve them to have a clean CI. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
TimerSetto execute scheduled tasks. This primarily allows for multiplexing of threads in order to avoid having many "polling" threads which are primarily idle.on_expired_sessionhandler for everyZookeeper(Poll)?Watcherand instead, only use one per ZK client (which is shared). This requires a slightly different callback, but works the same.Note: I am not sure if this complexity is worth the gain. While this reduces the number of threads, the large portion of main memory usage comes from the additional dual-read watchers, which still exist. Perhaps just doing 1 is enough because it's simpler and less risky.
Testing
master, whereas the other two are running this branch of Synapse.Misc
One clear benefit is that the CPU usage is reduced to somewhere between 33% and 50% of the original (again, purple is running

masterand other two are running this branch):Reviewers
@austin-zhu @gmcatsf @Jason-Jian