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

Various fixups #38

Merged
merged 6 commits into from
Feb 28, 2024
Merged

Various fixups #38

merged 6 commits into from
Feb 28, 2024

Conversation

wgreenberg
Copy link
Collaborator

@wgreenberg wgreenberg commented Feb 14, 2024

Just a couple fixups i've been thinking about:

  • reworks most of our disk IO to be async to better jive with the http server
  • new QMDL store format which maintains a "last message time" rather than an "end time", which is a bit easier to keep consistent on crashes (and IMO a more useful stat)

Not ready for merging yet, but wouldn't mind a first-pass review

@wgreenberg wgreenberg marked this pull request as draft February 14, 2024 04:39
@@ -123,7 +124,7 @@ impl DiagDevice {
})
}

pub fn write_request(&mut self, req: &Request) -> DiagResult<()> {
fn write_request(&mut self, req: &Request) -> DiagResult<()> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why did we decide this function is no longer public?

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 not used anywhere but internally to the module, and (for now) there's no requests an outside user would send besides the ones we're already using internally

Copy link
Collaborator

@cooperq cooperq left a comment

Choose a reason for hiding this comment

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

I'm aware this is WIP and still has bugs

This way, even if the program exits unexpectedly, there's a reasonable
value for the "end time" of a log.
@wgreenberg wgreenberg force-pushed the various-fixups branch 2 times, most recently from 7ef1031 to d156401 Compare February 23, 2024 03:15
@wgreenberg
Copy link
Collaborator Author

Finally tracked down the weird async race condition stuff, so imo this is now ready for review! We should do some field testing with these changes, but I'm fine if that happens either as a build from this branch, or a build from main after we merge it.

Mixing async and sync I/O leads to a multitude of complications, and
generally speaking it's much more convenient to stick to one paradigm
or the other. Since axum (and many other HTTP servers) use async,
and since async is a convenient model for performing operations like
"handle an MPSC message or file read, whichever happens first", let's
commit to an async interface.
@cooperq cooperq marked this pull request as ready for review February 27, 2024 19:56
@cooperq cooperq merged commit 6777372 into main Feb 28, 2024
1 check passed
@cooperq cooperq deleted the various-fixups branch June 6, 2024 22:58
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