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

Spike - Long Drop processing during panic? #405

Open
dnwiebe opened this issue Jan 23, 2023 · 0 comments
Open

Spike - Long Drop processing during panic? #405

dnwiebe opened this issue Jan 23, 2023 · 0 comments
Labels
spike The deliverable for this card is one or more additional cards

Comments

@dnwiebe
Copy link
Collaborator

dnwiebe commented Jan 23, 2023

We may at some point want to do some time-consuming processing during a panic--for example, if we're holding data in memory that will at some point be written to the database, but a panic occurs before the write is scheduled, we might want to do the writes to the database after the panic occurs but before the program actually halts.

We don't know at this point whether all three operating systems will allow us to run for several seconds during a panic: it seems reasonable that after telling a process to terminate, an OS would keep track of it and forcibly kill it if it didn't die after a short time.

Write a test (suggested project: masq_lib) that involves a struct for which the Drop trait is implemented. Have the Drop handler do something that takes ten or fifteen seconds--something other than just sleeping, since the OS is in charge of sleeping and may deceive us during a panic. Create an instance of the struct and panic; see if the Drop handler is permitted to take all the time it needs, or whether it's interrupted by the OS. (This test may be a little ticklish, since it involves a panic.)

We are pretty sure Linux will wait for at least fifteen seconds; we don't know about macOS or Windows.

The test doesn't need to become a permanent part of the codebase, since it will necessarily suck up lots of test runtime, but the results of the test should be appended to this card for posterity, so that we can come back and look at them after we forget what happens.

@dnwiebe dnwiebe changed the title Spike - Long Drop processing during panic? Spike - Long Drop processing during panic? Jan 23, 2023
@kauri-hero kauri-hero added the spike The deliverable for this card is one or more additional cards label Jan 29, 2023
@kauri-hero kauri-hero added this to the Graceful Shutdown milestone Jan 29, 2023
@kauri-hero kauri-hero transferred this issue from MASQ-Project/MASQ-Node-issues Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
spike The deliverable for this card is one or more additional cards
Projects
Status: 🔖 Ready
Status: Ready for Development
Development

No branches or pull requests

2 participants