Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
librbd/migration/HttpClient: avoid hitting an assert in advance_state()
If the shutdown gets delayed until the state transition from STATE_RESET_CONNECTING completes and the reconnect is successful (i.e. next_state is STATE_READY), we eventually hit "unexpected state transition" assert in advance_state(). The reason is that advance_state() would update m_state and call disconnect() under STATE_READY instead of STATE_SHUTTING_DOWN. After the disconnect maybe_finalize_shutdown() would enter advance_state() again with STATE_SHUTDOWN as next_state, but the transition to that from STATE_READY is invalid. Plug this by not transitioning to next_state if current_state is STATE_SHUTTING_DOWN. Signed-off-by: Ilya Dryomov <[email protected]>
- Loading branch information