Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Objecter: check the 'initialized' atomic_t safely
shutdown() resets initialized to 0, but we can still receive messages after this point, so fix message handlers to skip messages in this case instead of asserting. Also read initialized while holding Objecter::rwlock to avoid races where e.g. handle_osd_map() checks initialized -> 1, continues, shutdown() is called, sets initialized to 0, then handle_osd_map() goes about its business and calls op_submit(), which would fail the assert(initialized.read()) check. Similar races existed in other message handlers which change Objecter state. The Objecter is not destroyed until after its Messenger in the MDS, OSD, and librados, so this should be safe. Fixes: #9617 Backport: giant Signed-off-by: Josh Durgin <josh.durgin@inktank.com> (cherry picked from commit e506f89) Conflicts: src/osdc/Objecter.cc context changed: Objecter::tick() did not have assert(initialized.read())
- Loading branch information
Showing
1 changed file
with
31 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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