Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plumb errors through TransactionStatusService instead of panicking #3236

Merged
merged 4 commits into from
Oct 22, 2024

Conversation

steviez
Copy link

@steviez steviez commented Oct 21, 2024

Problem

I was reviewing #3026 post-merge and noticed we had a handful of .expect() and .unwrap() in TransactionStatusService. These do not allow for graceful teardown of the process, so try to be nicer to other threads by initiating a more graceful teardown

Summary of Changes

  • Rework TransactionStatusService to raise/handle errors instead of .expect() and .unwrap()
  • Set validator exit flag if fatal error encountered
  • Add logs for service start/stop/error encountered

One additional item I'll call out is that the panic hook pretty quickly kills the entire process via this:

// Exit cleanly so the process don't limp along in a half-dead state
std::process::exit(1);

The sentiment behind that comment is still valid. However, enough threads respect the exit flag such that the process will still come down fairly quickly so I think setting the flag is ok in this scenario

@steviez steviez requested review from bw-solana and fkouteib October 21, 2024 07:52
Copy link

@bw-solana bw-solana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

I like the change to have separate receive/process at the top level too. This seems to better match the pattern we use elsewhere.

Would be good to wait for @fkouteib to review before merging since he spent more time here recently

Copy link

@fkouteib fkouteib left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for cleaning this up.

@steviez steviez merged commit 8923f78 into anza-xyz:master Oct 22, 2024
40 checks passed
@steviez steviez deleted the tss_cleanup_panics branch October 22, 2024 13:54
ray-kast pushed a commit to abklabs/agave that referenced this pull request Nov 27, 2024
…nza-xyz#3236)

Raise the error and set validator exit flag to allow other threads to
gracefully shutdown. Also add logs to indicate service start/stop
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.

3 participants