fix: keep slot IN_FLIGHT during execution so evaluator sees busy and drops instead of queuing
This commit is contained in:
parent
b714ac132e
commit
e461dfb7a7
|
|
@ -238,13 +238,15 @@ void *event_executor_thread(void *arg) {
|
|||
/* Fast path: check slot state without poll */
|
||||
if (atomic_load_explicit(&slot->state, memory_order_acquire) == EXECUTOR_SLOT_READY) {
|
||||
signal_entry_t sig = slot->signal;
|
||||
atomic_store_explicit(&slot->state, EXECUTOR_SLOT_FREE, memory_order_release);
|
||||
atomic_store_explicit(&slot->state, EXECUTOR_SLOT_IN_FLIGHT, memory_order_release);
|
||||
/* Drain eventfd so poll can block next time */
|
||||
uint64_t val;
|
||||
if (read(slot->eventfd, &val, sizeof(val)) < 0) {}
|
||||
|
||||
executor_execute_triangle(exec, &sig);
|
||||
|
||||
atomic_store_explicit(&slot->state, EXECUTOR_SLOT_FREE, memory_order_release);
|
||||
|
||||
int64_t now = now_mono_ms();
|
||||
if (last_keepalive_ms == 0 || now - last_keepalive_ms >= 30000) {
|
||||
executor_keepalive(exec);
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
#define EXECUTOR_SLOT_FREE 0
|
||||
#define EXECUTOR_SLOT_CLAIMED 1
|
||||
#define EXECUTOR_SLOT_READY 2
|
||||
#define EXECUTOR_SLOT_IN_FLIGHT 3
|
||||
|
||||
typedef struct {
|
||||
_Atomic int state;
|
||||
|
|
|
|||
Loading…
Reference in New Issue