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

bottomless2 boilerplate #1386

Merged
merged 1 commit into from
May 15, 2024
Merged

bottomless2 boilerplate #1386

merged 1 commit into from
May 15, 2024

Conversation

MarinPostma
Copy link
Collaborator

No description provided.

Copy link
Contributor

@LucioFranco LucioFranco left a comment

Choose a reason for hiding this comment

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

Left some comments but overall LGTM

bottomless2/' Outdated Show resolved Hide resolved
@@ -0,0 +1,179 @@
#![allow(dead_code, unused_variables, async_fn_in_trait)]
Copy link
Contributor

Choose a reason for hiding this comment

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

whats up with the async fn in trait stuff? Probably complaining about the send issues?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

linter complains because the trait is public API

bottomless2/src/lib.rs Outdated Show resolved Hide resolved
bottomless2/src/lib.rs Outdated Show resolved Hide resolved
bottomless2/src/lib.rs Show resolved Hide resolved
// job panicked. report and exit process. The program is crippled, from
// now on, so we just exit, and hope to restart on a fresh state.
tracing::error!("fatal error: bottomless job panicked: {e}");
std::process::exit(1);
Copy link
Contributor

Choose a reason for hiding this comment

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

should we make this choice at a higher layer? Seems a bit extreme here to abort the whole process at a layer this deep.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

it's hard to trust higher level to abort the process if this task panics. The invariant here is that the task is not allowed to panic. it can error, but not panic. There's nothing much that the higher layer can do, the program is busted at this point. BTW, this is what assert should do: if you fail an assertion you exit the program.

max_frame_no: u64,
}

pub trait Storage: Send + Sync {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can use https://docs.rs/trait-variant/0.1.2/trait_variant/ to make the async fn sendable.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we'll see it's that's necessary later

@MarinPostma MarinPostma added this pull request to the merge queue May 15, 2024
Merged via the queue into main with commit 5c499c0 May 15, 2024
17 checks passed
@MarinPostma MarinPostma deleted the bottomless-v2 branch May 15, 2024 14:22
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.

None yet

2 participants