Handle SIGINT #2

Closed
opened 2026-03-21 23:34:30 +01:00 by maleszka · 1 comment
Owner

Fetcher's may take a lot of time in some cases. We should implement a SIGINT signal handler that sets some atomic bool and PlatformAPI should check for that.

I think, a good place to check for such a global bool might be every fetch call in PlatformAPI.

Fetcher's may take a lot of time in some cases. We should implement a SIGINT signal handler that sets some atomic bool and PlatformAPI should check for that. I think, a good place to check for such a global bool might be every fetch call in PlatformAPI.
maleszka added this to the 0.1.0 milestone 2026-04-09 17:06:22 +02:00
Author
Owner

Just for the sake of simplicity, I don't think we need a SIGINT handler. Without one, wbij simply crashes on Ctlr-c but that's fine. The only thing that we should tidy up is the cache .lock. But we don't need to --- wbij is designed to gracefully withstand crashes and cache is always kept in coherent state.

Adding SIGINT handler would require introducing an atomic bool and a separate thread, or polling a pipe between two threads --- a lot of complexity for a problem that does not exist.

We should only revisit this issue if we introduce threads to our architecture at some point

Just for the sake of simplicity, I don't think we _need_ a SIGINT handler. Without one, wbij simply crashes on Ctlr-c but _that's fine_. The only thing that we _should_ tidy up is the cache `.lock`. But we _don't need_ to --- wbij is designed to gracefully withstand crashes and cache is always kept in coherent state. Adding SIGINT handler would require introducing an atomic bool and a separate thread, or polling a pipe between two threads --- a lot of complexity for a problem that does not exist. We should only revisit this issue if we introduce threads to our architecture at some point
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
maleszka/wbij#2
No description provided.