You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "dybyte (via GitHub)" <gi...@apache.org> on 2025/09/03 15:02:47 UTC

[PR] [Fix][Zeta] Handle null startTimestamp in `BaseService` to fix flaky `MysqlCDCWithBinlogDeleteIT` test [seatunnel]

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

   ### Purpose of this pull request
   
   I observed that the `testRestoreTaskWhenBinlogDelete` test in `MysqlCDCWithBinlogDeleteIT` occasionally fails in CI.
   ```
   ERROR org.apache.seatunnel.engine.server.rest.filter.ExceptionHandlingFilter - Error occurred while processing request
   2025-09-03T06:28:36.6933917Z java.lang.NullPointerException: null
   2025-09-03T06:28:36.6934361Z 	at org.apache.seatunnel.engine.server.rest.service.BaseService.getJobStartTime(BaseService.java:213) ~[seatunnel-starter.jar:2.3.12-SNAPSHOT]
   2025-09-03T06:28:36.6934783Z 	at org.apache.seatunnel.engine.server.rest.service.BaseService.convertToJson(BaseService.java:184) ~[seatunnel-starter.jar:2.3.12-SNAPSHOT]
   2025-09-03T06:28:36.6935241Z 	at org.apache.seatunnel.engine.server.rest.service.JobInfoService.getJobInfoJson(JobInfoService.java:69) ~[seatunnel-starter.jar:2.3.12-SNAPSHOT]
   2025-09-03T06:28:36.6935650Z 	at org.apache.seatunnel.engine.server.rest.servlet.JobInfoServlet.doGet(JobInfoServlet.java:52) ~[seatunnel-starter.jar:2.3.12-SNAPSHOT]
   2025-09-03T06:28:36.6935976Z 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:687) ~[seatunnel-hadoop3-3.1.4-uber.jar:2.3.12-SNAPSHOT]
   2025-09-03T06:28:36.6936290Z 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) ~[seatunnel-hadoop3-3.1.4-uber.jar:2.3.12-SNAPSHOT]
   2025-09-03T06:28:36.6936803Z 	at org.apache.seatunnel.shade.org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799) ~[seatunnel-starter.jar:2.3.12-SNAPSHOT]
   2025-09-03T06:28:36.6937284Z 	at org.apache.seatunnel.shade.org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1656) ~[seatunnel-starter.jar:2.3.12-SNAPSHOT]
   2025-09-03T06:28:36.6937783Z 	at org.apache.seatunnel.engine.server.rest.filter.ExceptionHandlingFilter.doFilter(ExceptionHandlingFilter.java:50) ~[seatunnel-starter.jar:2.3.12-SNAPSHOT]
   2025-09-03T06:28:36.6938211Z 	at org.apache.seatunnel.shade.org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193) ~[seatunnel-starter.jar:2.3.12-SNAPSHOT]
   2025-09-03T06:28:36.6938669Z 	at org.apache.seatunnel.shade.org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1626) ~[seatunnel-starter.jar:2.3.12-SNAPSHOT]
   2025-09-03T06:28:36.6939175Z 	at org.apache.seatunnel.shade.org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:552) ~[seatunnel-starter.jar:2.3.12-SNAPSHOT]
   2025-09-03T06:28:36.6939653Z 	at org.apache.seatunnel.shade.org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233) ~[seatunnel-starter.jar:2.3.12-SNAPSHOT]
   2025-09-03T06:28:36.6940124Z 	at org.apache.seatunnel.shade.org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624) ~[seatunnel-starter.jar:2.3.12-SNAPSHOT]
   2025-09-03T06:28:36.6940656Z 	at org.apache.seatunnel.shade.org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233) ~[seatunnel-starter.jar:2.3.12-SNAPSHOT]
   2025-09-03T06:28:36.6941136Z 	at org.apache.seatunnel.shade.org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1440) ~[seatunnel-starter.jar:2.3.12-SNAPSHOT]
   2025-09-03T06:28:36.6941665Z 	at org.apache.seatunnel.shade.org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188) ~[seatunnel-starter.jar:2.3.12-SNAPSHOT]
   2025-09-03T06:28:36.6942104Z 	at org.apache.seatunnel.shade.org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:505) ~[seatunnel-starter.jar:2.3.12-SNAPSHOT]
   2025-09-03T06:28:36.6942577Z 	at org.apache.seatunnel.shade.org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594) ~[seatunnel-starter.jar:2.3.12-SNAPSHOT]
   2025-09-03T06:28:36.6943041Z 	at org.apache.seatunnel.shade.org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186) ~[seatunnel-starter.jar:2.3.12-SNAPSHOT]
   2025-09-03T06:28:36.6943746Z 	at org.apache.seatunnel.shade.org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1355) ~[seatunnel-starter.jar:2.3.12-SNAPSHOT]
   2025-09-03T06:28:36.6944211Z 	at org.apache.seatunnel.shade.org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) ~[seatunnel-starter.jar:2.3.12-SNAPSHOT]
   2025-09-03T06:28:36.6944679Z 	at org.apache.seatunnel.shade.org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) ~[seatunnel-starter.jar:2.3.12-SNAPSHOT]
   2025-09-03T06:28:36.6945048Z 	at org.apache.seatunnel.shade.org.eclipse.jetty.server.Server.handle(Server.java:516) ~[seatunnel-starter.jar:2.3.12-SNAPSHOT]
   2025-09-03T06:28:36.6945477Z 	at org.apache.seatunnel.shade.org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:487) ~[seatunnel-starter.jar:2.3.12-SNAPSHOT]
   2025-09-03T06:28:36.6945894Z 	at org.apache.seatunnel.shade.org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:732) ~[seatunnel-starter.jar:2.3.12-SNAPSHOT]
   2025-09-03T06:28:36.6946303Z 	at org.apache.seatunnel.shade.org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:479) ~[seatunnel-starter.jar:2.3.12-SNAPSHOT]
   2025-09-03T06:28:36.6946750Z 	at org.apache.seatunnel.shade.org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277) ~[seatunnel-starter.jar:2.3.12-SNAPSHOT]
   2025-09-03T06:28:36.6947254Z 	at org.apache.seatunnel.shade.org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) ~[seatunnel-starter.jar:2.3.12-SNAPSHOT]
   2025-09-03T06:28:36.6947731Z 	at org.apache.seatunnel.shade.org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105) ~[seatunnel-starter.jar:2.3.12-SNAPSHOT]
   2025-09-03T06:28:36.6948137Z 	at org.apache.seatunnel.shade.org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104) ~[seatunnel-starter.jar:2.3.12-SNAPSHOT]
   2025-09-03T06:28:36.6948635Z 	at org.apache.seatunnel.shade.org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338) ~[seatunnel-starter.jar:2.3.12-SNAPSHOT]
   2025-09-03T06:28:36.6949136Z 	at org.apache.seatunnel.shade.org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315) ~[seatunnel-starter.jar:2.3.12-SNAPSHOT]
   2025-09-03T06:28:36.6949648Z 	at org.apache.seatunnel.shade.org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173) ~[seatunnel-starter.jar:2.3.12-SNAPSHOT]
   2025-09-03T06:28:36.6950183Z 	at org.apache.seatunnel.shade.org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131) ~[seatunnel-starter.jar:2.3.12-SNAPSHOT]
   2025-09-03T06:28:36.6950748Z 	at org.apache.seatunnel.shade.org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409) ~[seatunnel-starter.jar:2.3.12-SNAPSHOT]
   2025-09-03T06:28:36.6951220Z 	at org.apache.seatunnel.shade.org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883) ~[seatunnel-starter.jar:2.3.12-SNAPSHOT]
   2025-09-03T06:28:36.6951742Z 	at org.apache.seatunnel.shade.org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034) ~[seatunnel-starter.jar:2.3.12-SNAPSHOT]
   2025-09-03T06:28:36.6951874Z 	at java.lang.Thread.run(Thread.java:750) [?:1.8.0_342]
   ```
   
   This failure is caused by a NullPointerException in the `getJobStartTime` method of `BaseService`.
   This PR fixes the NPE in `getJobStartTime`, which eliminates the flakiness of the `testRestoreTaskWhenBinlogDelete` test.
   
   
   ### Does this PR introduce _any_ user-facing change?
   
   No
   
   ### How was this patch tested?
   
   Covered by existing 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 you are contributing the connector code, please check that the following files are updated:
     1. Update [plugin-mapping.properties](https://github.com/apache/seatunnel/blob/dev/plugin-mapping.properties) and add new connector information in it
     2. Update the pom file of [seatunnel-dist](https://github.com/apache/seatunnel/blob/dev/seatunnel-dist/pom.xml)
     3. Add ci label in [label-scope-conf](https://github.com/apache/seatunnel/blob/dev/.github/workflows/labeler/label-scope-conf.yml)
     4. Add e2e testcase in [seatunnel-e2e](https://github.com/apache/seatunnel/tree/dev/seatunnel-e2e/seatunnel-connector-v2-e2e/)
     5. Update connector [plugin_config](https://github.com/apache/seatunnel/blob/dev/config/plugin_config)


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Fix][Zeta] Handle null startTimestamp in `BaseService` to fix flaky `MysqlCDCWithBinlogDeleteIT` test [seatunnel]

Posted by "Hisoka-X (via GitHub)" <gi...@apache.org>.
Hisoka-X commented on PR #9815:
URL: https://github.com/apache/seatunnel/pull/9815#issuecomment-3257485254

   > I think the NPE occurs because restoreJob executes asynchronously, and getJobStatus() is called inside the await() before the job is fully initialized
   
   Should not be. Because the error exception came from rest api. `getJobStatus` use RPC.


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Fix][Zeta] Handle null startTimestamp in `BaseService` to fix flaky `MysqlCDCWithBinlogDeleteIT` test [seatunnel]

Posted by "corgy-w (via GitHub)" <gi...@apache.org>.
corgy-w merged PR #9815:
URL: https://github.com/apache/seatunnel/pull/9815


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Fix][Zeta] Handle null startTimestamp in `BaseService` to fix flaky `MysqlCDCWithBinlogDeleteIT` test [seatunnel]

Posted by "Hisoka-X (via GitHub)" <gi...@apache.org>.
Hisoka-X commented on PR #9815:
URL: https://github.com/apache/seatunnel/pull/9815#issuecomment-3254015380

   Hi @dybyte . I think add a unit test would be better. But also not a big deal if not.


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Fix][Zeta] Handle null startTimestamp in `BaseService` to fix flaky `MysqlCDCWithBinlogDeleteIT` test [seatunnel]

Posted by "Hisoka-X (via GitHub)" <gi...@apache.org>.
Hisoka-X commented on PR #9815:
URL: https://github.com/apache/seatunnel/pull/9815#issuecomment-3261655192

   Oh. Looks make sense. So I think the patch is great!


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Fix][Zeta] Handle null startTimestamp in `BaseService` to fix flaky `MysqlCDCWithBinlogDeleteIT` test [seatunnel]

Posted by "dybyte (via GitHub)" <gi...@apache.org>.
dybyte commented on PR #9815:
URL: https://github.com/apache/seatunnel/pull/9815#issuecomment-3257060272

   > I'm a little curious why it would be null.
   
   I think the NPE occurs because restoreJob executes asynchronously, and getJobStatus() is called inside the await() before the job is fully initialized. But I’m not entirely sure.
   ```java
   CompletableFuture.supplyAsync(
                   () -> {
                       try {
                           container.restoreJob(
                                   "/mysqlcdc_to_mysql_with_binlog_delete.conf",
                                   String.valueOf(jobId));
                       } catch (Exception e) {
                           log.error("Commit task exception :" + e.getMessage());
                           throw new RuntimeException(e);
                       }
                       return null;
                   });
           await().atMost(2, TimeUnit.MINUTES)
                   .untilAsserted(
                           () -> {
                               String jobStatus = container.getJobStatus(String.valueOf(jobId));
                               Assertions.assertEquals("RUNNING", jobStatus);
                           });
   ```
   https://github.com/apache/seatunnel/blob/2653f6798efeced85cc4bb0db3fb9e181bf8bf5e/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-cdc-mysql-e2e/src/test/java/org/apache/seatunnel/connectors/seatunnel/cdc/mysql/MysqlCDCWithBinlogDeleteIT.java#L179


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Fix][Zeta] Handle null startTimestamp in `BaseService` to fix flaky `MysqlCDCWithBinlogDeleteIT` test [seatunnel]

Posted by "dybyte (via GitHub)" <gi...@apache.org>.
dybyte commented on PR #9815:
URL: https://github.com/apache/seatunnel/pull/9815#issuecomment-3258078306

   I have confirmed that the issue occurs because the job's start timestamp is accessed before it reaches the SCHEDULED state, as shown in the following code:
   https://github.com/apache/seatunnel/blob/c43d57de31e13f1006cc2fcf533870863994231d/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/dag/physical/PhysicalPlan.java#L305-L310
   
   https://github.com/apache/seatunnel/blob/c43d57de31e13f1006cc2fcf533870863994231d/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/dag/physical/PhysicalPlan.java#L227-L233
   
   This is all I was able to confirm. If you have any additional insights, I would greatly appreciate it. Thank you!


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org