nzw921rx opened a new pull request, #13251:
URL: https://github.com/apache/seatunnel/pull/13251

   ### Purpose of this pull request
   
   Yes, I am contributing this readability improvement to Apache SeaTunnel.
   
   `MultiTableSinkWriter.close()` currently waits for in-progress table 
isolation through an empty `synchronized (this)` block. Its relationship with 
the flush failure path is difficult to identify at the call site.
   
   Extract the block into `awaitTableIsolation()`, synchronized on the same 
writer instance. Document the stop-signal precondition, how the shared monitor 
coordinates shutdown with table isolation, and why the monitor is released 
before acquiring queue locks. Update the flush-side comment to identify the 
corresponding wait in `close()`.
   
   Follow-up to #13201.
   
   ### Does this PR introduce any user-facing change?
   
   No. This is a private method extraction and comment clarification. The 
existing stop-signal ordering, monitor ownership, and queue-lock ordering are 
preserved.
   
   ### How was this patch tested?
   
   - Ran `spotless:apply` and API reactor `verify` with all `MultiTable*Test` 
classes: **46 tests passed**, with no failures, errors, or skips.
   - Ran `git diff --check`.
   - Replayed an external writer-lifecycle probe using the production JDBC 
writer against MySQL 8.0.36, Connector/J 8.0.27, and JDK 11.0.29. With two 
writer queues and `CONTINUE_OTHER_TABLES`, the probe first committed 
healthy-table data, then held a database row lock in one flush while another 
table failed and entered isolation. It invoked `close()` during this overlap 
and captured the close thread waiting inside `awaitTableIsolation()` on the 
writer monitor.
   - Released the database lock after approximately 2.56 seconds. Closing 
returned approximately 7.9 ms after release; the healthy-table data and the 
released write matched expectations.
   
   No new repository tests were added: the extraction preserves the existing 
synchronization semantics, which were checked with the existing regression 
suite and the JDBC probe.
   


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