-
Notifications
You must be signed in to change notification settings - Fork 22
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
fix: graceful exit #684
base: main
Are you sure you want to change the base?
fix: graceful exit #684
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally but this does not solve the problem
Found and fixed and another commit issue with p2pool locking RWLock which caused dangling p2pool process. It was due p2pool trying to get status from status monitor which was already killed. |
src-tauri/src/process_watcher.rs
Outdated
@@ -68,7 +68,9 @@ impl<TAdapter: ProcessAdapter> ProcessWatcher<TAdapter> { | |||
loop { | |||
select! { | |||
_ = watch_timer.tick() => { | |||
info!(target: LOG_TARGET, "Checking if {} is running", name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
info!(target: LOG_TARGET, "Checking if {} is running", name); | |
debug!(target: LOG_TARGET, "Checking if {} is running", name); |
src-tauri/src/process_watcher.rs
Outdated
if child.ping() { | ||
info!(target: LOG_TARGET, "{} is running", name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
info!(target: LOG_TARGET, "{} is running", name); | |
debug!(target: LOG_TARGET, "{} is running", name); |
src-tauri/src/p2pool_manager.rs
Outdated
@@ -147,11 +147,12 @@ impl P2poolManager { | |||
.await?; | |||
process_watcher.wait_ready().await?; | |||
if let Some(status_monitor) = &process_watcher.status_monitor { | |||
loop { | |||
for attempt in 1..=5 { | |||
sleep(Duration::from_secs(5)).await; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
5 seconds is very long here, rather make it 1 second but run more attempts
Description
Exiting app during initialization (especially during connecting to other peers) caused app to run some processes in the background.
Motivation and Context
Fix issue describe above.
How Has This Been Tested?
Run TU and exit during initialization while looking for other peers in the network.
What process can a PR reviewer use to test or verify this change?
Same as above
Breaking Changes