-
Notifications
You must be signed in to change notification settings - Fork 53
Cannot :ack task after implicit net.box reconnect #85
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
Comments
A note from @printercu: if we'll allow reconnects, then we possibly should not automatically release tasks in on_disconnect trigger. |
Maybe this should be an option because it depends on queue type: I use The other related bug is that task can not be handled from different fibers within single process: |
Before the patch a connection to server was synonym of the queue session. Now the session has a unique UUID (returned by the "queue.identificate()" method), and one session can have many connections. The session will be deleted (all session tasks will be released) after the last connection is disconnected. To connect to an existing session, call "queue.identificate(uuid)" with the previously obtained UUID. Part of #85
The patch added the ability to set the queue settings(by calling "queue.set_settings(opts)"). Now only one setting is available - "ttr"(time to release). "ttr" in seconds - the time after which, if there is no active connection in the session, it will be released with all its tasks. Part of #85
"ttr" in seconds - the time after which, if there is no active connection in the session, it will be released with all its tasks. Closes #85
Before the patch a connection to server was synonym of the queue session. Now the session has a unique UUID (returned by the "queue.identificate()" method), and one session can have many connections. The session will be deleted (all session tasks will be released) after the last connection is disconnected. To connect to an existing session, call "queue.identificate(uuid)" with the previously obtained UUID. Part of #85
The patch added the ability to set the queue settings(by calling "queue.set_settings(opts)"). Now only one setting is available - "ttr"(time to release). "ttr" in seconds - the time after which, if there is no active connection in the session, it will be released with all its tasks. Part of #85
"ttr" in seconds - the time after which, if there is no active connection in the session, it will be released with all its tasks. Closes #85
Before the patch a connection to server was synonym of the queue session. Now the session has a unique UUID (returned by the "queue.identificate()" method), and one session can have many connections. The session will be deleted (all session tasks will be released) after the last connection is disconnected. To connect to an existing session, call "queue.identificate(uuid)" with the previously obtained UUID. Part of #85
The patch added the ability to set the queue settings(by calling "queue.set_settings(opts)"). Now only one setting is available - "ttr"(time to release). "ttr" in seconds - the time after which, if there is no active connection in the session, it will be released with all its tasks. Part of #85
"ttr" in seconds - the time after which, if there is no active connection in the session, it will be released with all its tasks. Closes #85
Before the patch a connection to server was synonym of the queue session. Now the session has a unique UUID (returned by the "queue.identificate()" method), and one session can have many connections. The session will be deleted (all session tasks will be released) after the last connection is disconnected. To connect to an existing session, call "queue.identificate(uuid)" with the previously obtained UUID. Part of #85
The patch added the ability to set the queue settings(by calling "queue.set_settings(opts)"). Now only one setting is available - "ttr"(time to release). "ttr" in seconds - the time after which, if there is no active connection in the session, it will be released with all its tasks. Part of #85
"ttr" in seconds - the time after which, if there is no active connection in the session, it will be released with all its tasks. Closes #85
In the future, we will refuse to use the "pk" index of the "_queue_taken" space to improve performance. So, let's minimize its use. Needed for #85
Before the patch a connection to server was synonym of the queue session. Now the session has a unique UUID (returned by the "queue.identify()" method), and one session can have many connections. The session will be deleted (all session tasks will be released) after "ttr" seconds have passed since the last connection was disconnected. To connect to an existing session, call "queue.identificate(uuid)" with the previously obtained UUID. "ttr" in seconds - the time after which, if there is no active connection in the session, it will be released with all its tasks. Also, the "_queue_taken" internal space has been replaced with the "_queue_taken_2" with a change format and used indexes (for better performance). The downgrade to previous version works correctly. Closes of #85
In the future, we will refuse to use the "pk" index of the "_queue_taken" space to improve performance (the conclusion about the improvement in performance is based on the benchmarks that will be added in one of the next commits). So, let's minimize its use. Needed for #85
The same time functions are used in several files, so move them to a separate file. Needed for #85
The patch adds the ability to set the queue settings(by calling "queue.cfg(opts)"). Now only one setting is available - "ttr"(time to release). "ttr" in seconds - the time after which, if there is no active connection in the session, it will be released with all its tasks. Part of #85
Before the patch a connection to server was synonym of the queue session. Now the session has a unique UUID (returned by the "queue.identify()" method), and one session can have many connections. The session will be deleted (all session tasks will be released) after "ttr" seconds have passed since the last connection was disconnected. To connect to an existing session, call "queue.identificate(uuid)" with the previously obtained UUID. "ttr" in seconds - the time after which, if there is no active connection in the session, it will be released with all its tasks. Also, the "_queue_taken" internal space has been replaced with the "_queue_taken_2" with a change format and used indexes (for better performance). The downgrade to previous version works correctly. Closes of #85
Before the patch a connection to server was synonym of the queue session. Now the session has a unique UUID (returned by the "queue.identify()" method), and one session can have many connections. The session will be deleted (all session tasks will be released) after "ttr" seconds have passed since the last connection was disconnected. To connect to an existing session, call "queue.identificate(uuid)" with the previously obtained UUID. "ttr" in seconds - the time after which, if there is no active connection in the session, it will be released with all its tasks. Also, the "_queue_taken" internal space has been replaced with the "_queue_taken_2" with a change format and used indexes (for better performance). The downgrade to previous version works correctly. Closes of #85
In the future, we will refuse to use the "pk" index of the "_queue_taken" space to improve performance (the conclusion about the improvement in performance is based on the benchmarks that will be added in one of the next commits). So, let's minimize its use. Needed for #85
The same time functions are used in several files, so move them to a separate file. Needed for #85
The patch adds the ability to set the queue settings(by calling "queue.cfg(opts)"). Now only one setting is available - "ttr"(time to release). "ttr" in seconds - the time after which, if there is no active connection in the session, it will be released with all its tasks. Part of #85
Before the patch a connection to server was synonym of the queue session. Now the session has a unique UUID (returned by the "queue.identify()" method), and one session can have many connections. The session will be deleted (all session tasks will be released) after "ttr" seconds have passed since the last connection was disconnected. To connect to an existing session, call "queue.identificate(uuid)" with the previously obtained UUID. "ttr" in seconds - the time after which, if there is no active connection in the session, it will be released with all its tasks. Also, the "_queue_taken" internal space has been replaced with the "_queue_taken_2" with a change format and used indexes (for better performance). The downgrade to previous version works correctly. Closes of #85
Prerequisite
net.box
connectionScenario
net.box
connection and start processing itnet.box
decides to reconnectack
the task.ack
command with error -Task was not taken in the session
ttr
delay task returned to theREADY
stateProblem description
This "
ack
error" happen because tarantool/queue locks "taken" task tobox.session.id()
. That means that not only the same client musttake
andack
the same task, but it has to be done inside the samenet.box
connection, sincebox.session.id()
updates after implicit reconnect. That implies that client has no way to handle such error from the server and retryack
.Possible solutions
There is a possible workaround to eliminate this kind of errors is to implement a simple buffer (
fiber.channel
) on the server with clientack
commands and let another fiber to call an actualqueue:ack
. But this is not very handy, if you want to handleack
response on the client.Another way to approach this is to use different
id
to lock a task. Thisid
should determine the same client even through implicitnet.box
reconnect calls. This id may be set explicitly through some registration process (api breaking change) or implicitly using some tarantool client information (if exists).Is this reasoning correct? Are there any different approaches/workarounds?
The text was updated successfully, but these errors were encountered: