[SIGNIFICANT] Shutdown doesn't wait for services to actually stop #24
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
In
main.rs, shutdown callssupervisor.stop_all_services().awaitand then immediately after the select arm completes:ipc_handle.abort()-- kills the IPC servercommand_handle.abort()-- kills the command handlerThe
stop_all_servicesmethod sends stop events to the event queue and returns -- it does NOT wait for services to actually exit. The supervisor's event loop exits whenshutdown = true, so stop events in the queue may never be processed.Impact
Services are killed abruptly during shutdown without graceful termination. Data loss, corrupted state, and incomplete cleanup. This defeats the purpose of ordered shutdown.
Files
crates/my_init_server/src/main.rs-- shutdown select blockSuggested Fix
The issue description referencing crates/my_init_server/src/main.rs confirms that the shutdown select block calls supervisor.stop_all_services().await which sends stop events to the event queue but does not await their completion. The IPC and command handles are aborted immediately after.