yzeng1618 opened a new pull request, #10131:
URL: https://github.com/apache/seatunnel/pull/10131
<!--
Thank you for contributing to SeaTunnel! Please make sure that your code
changes
are covered with tests. And in case of new features or big changes
remember to adjust the documentation.
-->
### Purpose of this pull request
Fix a bug where the Iceberg streaming source enumerator crashes with
`IllegalMonitorStateException: current thread is not owner` when running
in STREAMING job mode (e.g. with `stream_scan_strategy =
TABLE_SCAN_THEN_INCREMENTAL`).
The root cause is that `wait()` / `notifyAll()` on `stateLock` were called
without holding the monitor in `IcebergStreamSplitEnumerator.run` /
`handleSplitRequest`. This PR:
- Wraps `stateLock.wait(...)` and `stateLock.notifyAll()` in `synchronized
(stateLock)` blocks.
- Adds a minimal unit test `IcebergStreamSplitEnumeratorTest` to guard the
fix.
### Does this PR introduce _any_ user-facing change?
Yes.
Previously, Iceberg source jobs in streaming mode could fail with
`IllegalMonitorStateException` from `IcebergStreamSplitEnumerator`, causing
the
SeaTunnel job to terminate unexpectedly. After this fix, the streaming
enumerator
no longer throws this exception and the job can run normally without config
changes.
### How was this patch tested?
- Added unit test `IcebergStreamSplitEnumeratorTest` to verify that
`handleSplitRequest` no longer throws `IllegalMonitorStateException` when
triggering the notify logic.
- (Optional) Run connector-iceberg module tests locally:
- `mvn -pl seatunnel-connectors-v2/connector-iceberg test`
### Check list
* [ ] If any new Jar binary package adding in your PR, please add License
Notice according
[New License
Guide](https://github.com/apache/seatunnel/blob/dev/docs/en/contribution/new-license.md)
* [ ] If necessary, please update the documentation to describe the new
feature. https://github.com/apache/seatunnel/tree/dev/docs
* [ ] If necessary, please update `incompatible-changes.md` to describe the
incompatibility caused by this PR.
* [ ] If you are contributing the connector code, please check that the
following files are updated:
1. Update `plugin-mapping.properties` and add new connector information in
it
2. Update the pom file of `seatunnel-dist`
3. Add ci label in `.github/workflows/labeler/label-scope-conf.yml`
4. Add e2e testcase in `seatunnel-e2e/seatunnel-connector-v2-e2e/`
5. Update connector `config/plugin_config` if needed
--
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]