mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-28 20:27:03 +00:00
`migration_manager` lifetime is longer than the lifetime of "storage proxy's messaging service part" - that is, `init_messaging_service` is called after `migration_manager` is started, and `uninit_messaging_service` is called before `migration_manager` is stopped. Thus we don't need to hold an owning pointer to `migration_manager` here. Later, when `init_messaging_service` will actually construct `remote`, this will be a reference, not a pointer. Also observe that `_mm` in `remote` is only used in handlers, and handlers are unregistered before `_mm` is nullified, which ensures that handlers are not running when `_mm` is nullified. (This argument shows why the code made sense regardless of our switch from shared_ptr to raw ptr).