tarantool / queue

Create task queues, add and take jobs, monitor failed tasks
Other
237 stars 52 forks source link

bug: wrong session id in on_disconnect() trigger #103

Closed Totktonada closed 4 years ago

Totktonada commented 4 years ago

Tarantool had a bug with on_disconnect triggers, see https://github.com/tarantool/tarantool/issues/4627

Affected tarantool versions:

The module uses on_disconnect() triggers and may call box.session.id() after implicit yield (a :delete() call).

We possibly should work around this problem in the module itself, despite that it was fixed in recent tarantool versions.

The fix would be obvious: save a session_id at beginning of _on_consumer_disconnect() and pass it to :release() at the end (or, better, to an internal release function with this extra option to protect a user from using it). However I stuck for a while trying to write a test case that will show a bad behaviour of queue just using its public API.

Reported by @Mons.

olegrok commented 4 years ago

Do we really need to fix this problem if it is fixed in tarantool?

I think if customer can update tarantool queue rock, it could update tarantool version as well

Mons commented 4 years ago

This code could be run at older versions with bug