[FLINK-40675][sql-gateway] Fix unstable SqlGatewayServiceITCase#testReleaseLockWhenFailedToSubmitOperation - #29194
Conversation
MartijnVisser
left a comment
There was a problem hiding this comment.
Changing a test to fix an instability is usually the wrong layer, so why this one is different. The test assumed a pool thread is free once an operation reports FINISHED. It never was: the status is set inside the task, before the worker is back on the SynchronousQueue, and the CI logs show 500 active threads at the moment of rejection. Nothing the pool exposes reliably says a worker will accept work, so the successful submit is the wait, not a loosened assertion. It does give something up. A rejection that is spurious rather than saturation now goes unnoticed for ten seconds. It still fails when it should: with the lock release on rejection removed it hangs, as the old one did. The table stage is green, the only failure is FLINK-40664 and is unrelated.
| } | ||
| }, | ||
| Duration.ofSeconds(10), | ||
| "Failed to submit the operation after the pool had a free thread."); |
There was a problem hiding this comment.
This message says the opposite of what a timeout here means. If it fires, the pool never freed a thread.
There was a problem hiding this comment.
right, reworded: "The pool never freed a thread to accept the operation."
…eleaseLockWhenFailedToSubmitOperation Generated-by: Claude Code (Opus 5)
438f485 to
b925916
Compare
|
@SEPURI-SAI-KRISHNA Can you also open backport PRs to the |
|
Thanks for the review and merge. Opening the three backports. |
What is the purpose of the change
testReleaseLockWhenFailedToSubmitOperationfails on CI with aRejectedExecutionExceptionat its finalsubmitOperation. The first operation turnsFINISHEDon its pool thread, before that thread is back in the pool, and the pool hands work off through aSynchronousQueue. A submit right afterawaitOperationTerminationcan therefore still find no free thread.Brief change log
Verifying this change
SqlGatewayServiceITCasepasses.Does this pull request potentially affect one of the following parts:
@Public(Evolving): noDocumentation
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 5)