danielealbano / cachegrand

cachegrand - a modern data ingestion, processing and serving platform built for today's hardware
BSD 3-Clause "New" or "Revised" License
975 stars 34 forks source link

Ensure fibers switch back at the end of the function body #327

Closed danielealbano closed 1 year ago

danielealbano commented 1 year ago

In some cases the worker_op_wait_ms wrapper might return false, e.g. if the io_uring ring has been freed. When it happens it's legit that the fiber terminates because something else is going really bad or the application has been terminated using CTRL+C or a signal.

This will avoid cachegrand printing messages like

[...][ERROR      ][worker][id: 04][cpu: 04][fiber_scheduler] Internal error, the fiber <worker-fiber-storage-db-gc-deleted-entries> is terminating but the termination hasn't been requested
[...][ERROR      ][worker][id: 36][cpu: 36][fiber_scheduler] Internal error, the fiber <worker-fiber-storage-db-snapshot-rdb> is terminating but the termination hasn't been requested
[...][ERROR      ][worker][id: 04][cpu: 04][fiber_scheduler] Internal error, the fiber <worker-fiber-storage-db-snapshot-rdb> is terminating but the termination hasn't been requested

When there is no actual reason for it.