Skip to content

Always honor return value in BP process_events_async #2140

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

Closed
tnull opened this issue Mar 30, 2023 · 0 comments · Fixed by #2145
Closed

Always honor return value in BP process_events_async #2140

tnull opened this issue Mar 30, 2023 · 0 comments · Fixed by #2145
Assignees
Milestone

Comments

@tnull
Copy link
Contributor

tnull commented Mar 30, 2023

The current default for should_break is true, which is fine, except that we don't override it in the first case of the select, i.e., when ChannelManager::get_persistable_update_future is already available:

define_run_body!(persister,
chain_monitor, chain_monitor.process_pending_events_async(async_event_handler).await,
channel_manager, channel_manager.process_pending_events_async(async_event_handler).await,
gossip_sync, peer_manager, logger, scorer, should_break, {
select_biased! {
_ = channel_manager.get_persistable_update_future().fuse() => true,
exit = sleeper(Duration::from_millis(100)).fuse() => {
should_break = exit;
false
}
}

@tnull tnull changed the title Honor sleeper return value in BP process_events_async Always honor sleeper return value in BP process_events_async Mar 30, 2023
@tnull tnull changed the title Always honor sleeper return value in BP process_events_async Always honor return value in BP process_events_async Mar 30, 2023
@TheBlueMatt TheBlueMatt added this to the 0.0.115 milestone Mar 30, 2023
@TheBlueMatt TheBlueMatt self-assigned this Mar 30, 2023
TheBlueMatt added a commit to TheBlueMatt/rust-lightning that referenced this issue Apr 3, 2023
If `ChannelManager` is persistable before the async background
processor even starts, it may not even get around to overwriting
the `should_exit` flag before testing it, and the default value is
(incorrectly) true, causing an immediate unconditional exit.

The default value should simply be false.

Fixes lightningdevkit#2140
@TheBlueMatt TheBlueMatt linked a pull request Apr 3, 2023 that will close this issue
TheBlueMatt added a commit to TheBlueMatt/rust-lightning that referenced this issue Apr 4, 2023
If `ChannelManager` is persistable before the async background
processor even starts, it may not even get around to overwriting
the `should_exit` flag before testing it, and the default value is
(incorrectly) true, causing an immediate unconditional exit.

The default value should simply be false.

Fixes lightningdevkit#2140
TheBlueMatt added a commit to TheBlueMatt/rust-lightning that referenced this issue Apr 4, 2023
If `ChannelManager` is persistable before the async background
processor even starts, it may not even get around to overwriting
the `should_exit` flag before testing it, and the default value is
(incorrectly) true, causing an immediate unconditional exit.

The default value should simply be false.

Fixes lightningdevkit#2140
optout21 pushed a commit to optout21/rust-lightning that referenced this issue Jul 24, 2023
If `ChannelManager` is persistable before the async background
processor even starts, it may not even get around to overwriting
the `should_exit` flag before testing it, and the default value is
(incorrectly) true, causing an immediate unconditional exit.

The default value should simply be false.

Fixes lightningdevkit#2140
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 a pull request may close this issue.

2 participants