Skip to content

suggestion: Graceful shutdown instead of std::mem::forget + _exit(0)#2542

Merged
kevindeforth merged 2 commits intokd/2463-transaction-sender-integration-test-mem-forgetfrom
kd/2463-transaction-sender-integration-test-suggestion-graceful-shutdown
Mar 23, 2026
Merged

suggestion: Graceful shutdown instead of std::mem::forget + _exit(0)#2542
kevindeforth merged 2 commits intokd/2463-transaction-sender-integration-test-mem-forgetfrom
kd/2463-transaction-sender-integration-test-suggestion-graceful-shutdown

Conversation

@netrome
Copy link
Copy Markdown
Collaborator

@netrome netrome commented Mar 20, 2026

Suggestion for #2489

Note: This is just a PoC for another shutdown mechanism to verify we can do graceful shutdown with the nearcore actors. It is primarily claude generated without much iterations from me so it shouldn't necessarily be merged as-is.

@kevindeforth
Copy link
Copy Markdown
Contributor

kevindeforth commented Mar 21, 2026

Thank you for looking into this!

I did try to spawn and stop the actor system explicitly, but it still required a timeout to make the tests non-flaky, because actor_system.stop(); is non-blocking.
The big difference is that I didn't use

    near_store::db::RocksDB::block_until_all_instances_are_dropped();

which seems to solve this problem.

I have to look into this in more detail. I am also curious if the mpc node spawning it's own RocksDB instance might interfere with that block_until_all_instances_are_dropped function.

@netrome
Copy link
Copy Markdown
Collaborator Author

netrome commented Mar 21, 2026

I have to look into this in more detail. I am also curious if the mpc node spawning it's own RocksDB instance might interfere with that block_until_all_instances_are_dropped function.

I don't think the mpc node RocksDB instance would interfere with the nearcore one. Afaik they are completely isolated from each other.

@kevindeforth kevindeforth marked this pull request as ready for review March 23, 2026 16:11
@kevindeforth kevindeforth merged commit 47ab782 into kd/2463-transaction-sender-integration-test-mem-forget Mar 23, 2026
8 of 13 checks passed
@kevindeforth kevindeforth deleted the kd/2463-transaction-sender-integration-test-suggestion-graceful-shutdown branch March 23, 2026 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants