Skip to content
Snippets Groups Projects

fix: race condition in on_shutdown

Merged Georgy Moshkin requested to merge 120-race-condition-in-on_shutdown into master

Tarantool remote requests are handled in a IProto thread, and on_shutdown triggers are handled in the TX thread.

During shutdown we send a request to the leader, which introduces a race condition in case we are the leader. If iproto thread shuts down before the request is sent, it will never be handled.

The fix is simple: in case we are the leader during shutdown, don't send the request, instead handle the request directly in the TX thread.

The bug could be reproduced by adding a ::tarantool::fiber::sleep(std::time::Duration::from_secs(1)) in the beginning of the on_shutdown handler.

Closes #120 (closed)

Edited by Georgy Moshkin

Merge request reports

Merge request pipeline #10915 passed

Merge request pipeline passed for 04e17d60

Approved by

Merged by Georgy MoshkinGeorgy Moshkin 2 years ago (Aug 16, 2022 5:18pm UTC)

Pipeline #10919 passed

Pipeline passed for 04e17d60 on master

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading