]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
librbd/migration/HttpClient: avoid hitting an assert in advance_state()
authorIlya Dryomov <idryomov@gmail.com>
Wed, 11 Dec 2024 15:25:13 +0000 (16:25 +0100)
committerIlya Dryomov <idryomov@gmail.com>
Fri, 13 Dec 2024 12:44:45 +0000 (13:44 +0100)
commit1046d610e3d6852258e6c4bf0355d0d13fb197b4
treefa1ea8c948312ef4a523c55599e76fc9ee36841b
parent9fa0bcc67d79d90996cd4ec2b5af56d051ef6be7
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 <idryomov@gmail.com>
src/librbd/migration/HttpClient.cc