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
Add a check of the session state before take a task #108
Add a check of the session state before take a task #108
Conversation
79a544f
to
4e96760
Compare
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.
LGTM. Some questions were discussed verbally
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.
LGTM
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 vote for canceling fibers, which will not be able to proceed with the task. We even asked recently to do this automatically: tarantool/tarantool#4788 (just for information).
I would also describe what is the root of the problem in the test case. Very sketchy it may look so:
Put task, take it, take again (no more tasks, it'll be blocked in
tube.take()
), disconnect, schedule the fiber with blocked take (but don't run yet) (frommethod._on_consumer_disconnect
), release the task (frommethod._on_consumer_disconnect
), <here the scheduled fiber with blocked take will be executed>.The result is that the task will be in 'taken' state, however there is no consumer, which may work with it. The task likely will be stuck in this state until a server restart.
At least look whether you can improve the description and if so, spend a hour on it, please. (I often stuck with changes made several years ago w/o described reasoning, so maybe I overdramatize this, but anyway.)
4e96760
to
7791258
Compare
Updated |
Now two implementations have been presented, and you need to choose one. |
6d6abe3
to
2344c46
Compare
Leonid said that he met problems with approach with fiber.cancel(). The reason likely is caching of fiber conds (see compat.lua) and that Let's stick with the original Leonid's variant. |
Pushed two small fixups. |
We need to check of a session state before take a task after wait() because session maybe in disconnecting state and task will be hang in a take state after the session will be disconnected Fixes #104
e791fb5
to
5f07d75
Compare
Squashed them (Leonid agreed). |
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.
LGTM.
We need to check of a session state before take a task after wait()
because session maybe in disconnecting state and task will be
hang in a take state after the session will be disconnected
Fixes #104