apupier commented on PR #30711:
URL: https://github.com/apache/camel/pull/30711#issuecomment-7134324397
Updated to address all review feedback from the previous iteration:
- **Worker-side deadline expiry**: When a worker starts after the request
deadline, it claims the slot via CAS and throws a `TimeoutException`. This
completes the task future with `ExecutionException(cause: TimeoutException)`,
allowing the caller to record the `timeout_cancellation_requested` audit event
and return a proper failure object (`{"status": "failed", "error": "Evaluation
timed out; cancellation requested"}`), preventing `null` JSON responses or text
format NPEs.
- **Virtual thread executor non-blocking submission**: Configured
`ThreadPoolProfile` with `keepAliveTime(0, TimeUnit.MILLISECONDS)` and
`allowCoreThreadTimeOut(false)` so `BoundedExecutorService` uses non-blocking
`tryAcquire(0, TimeUnit.MILLISECONDS)`, preventing callers from blocking inside
`submit()` beyond their deadline.
- **Queue purge and lifecycle synchronization**: In
`SemanticEvaluationTimeoutTest`,
`preStartCancellationReleasesConcurrencySlotAndPurgesQueue` verifies
`queue::isEmpty` and task 3 queuing while worker 1 is still held; and
`stoppingConsoleWakesQueuedCallersImmediately` explicitly awaits task 2 in the
executor queue before stopping the console.
- Added regression tests `virtualThreadSubmissionDoesNotBlockBeyondDeadline`
and `workerStartingAfterDeadlineReturnsTimeoutResponse`.
_IBM Bob on behalf of apupier_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]