MOBIN-F commented on PR #12465:
URL: https://github.com/apache/seatunnel/pull/12465#issuecomment-5832803722

   Hi @DanielLeens, thanks for the review. Pushed as two commits.
   
   [Fix][Connector-V2] Release the WebSocket callback thread when the reader is 
closed
   - enqueue(): put() → offer(message, 500ms) inside while (!closed). 
Back-pressure unchanged while the reader drains; after close() the thread exits 
within one window and the frame is dropped, logged once per connection. Kept 
500ms internal rather than an Option — it's only a wake-up granularity.
   - reconnectTimes → AtomicInteger, keeping check-then-increment so the "after 
N reconnect attempts" message stays accurate.
   - connect() guards on closed, and both connect()/close() are synchronized — 
the flag alone is check-then-act. The lock is never held by enqueue() or a 
callback, so it can't reintroduce the block.
   - Test shouldReleaseCallbackThreadWhenClosedWhileQueueIsFull: queue_capacity 
= 1, nothing polls, then close() and assert the thread terminates. Written 
first to check it bites — fails with the thread leaked against the old put(), 
passes in 0.51s with the fix.
   
   [Test][Connector-V2] Add reconnect coverage for the WebSocket source
   The reconnect path had no behavioural test (every reader test set 
enable_reconnect = false), which is exactly the code the two notes above touch:
   


-- 
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]

Reply via email to