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

[I] 使用Doris连接器读取数据时报内存泄漏异常 [seatunnel]

angkorthomwdd opened a new issue, #9863:
URL: https://github.com/apache/seatunnel/issues/9863

   ### Search before asking
   
   - [x] I had searched in the [issues](https://github.com/apache/seatunnel/issues?q=is%3Aissue+label%3A%22bug%22) and found no similar issues.
   
   
   ### What happened
   
   使用Doris连接器读取数据时报内存泄漏异常,导致无法读取数据近而没有数据输出到控制台。
   
   ### SeaTunnel Version
   
   v2.3.11
   
   ### SeaTunnel Config
   
   ```conf
   {
       "env": {
       "job.name": "单表查询Doris表中指定字段数据",
       "job.mode": "batch",
       "parallelism": 1,
       "checkpoint.interval": 10000,
       "checkpoint.timeout": 60000
     },
     "source": [
       {
           "plugin_name": "doris",
           "fenodes": "192.168.0.60:8030",
           "username": "root",
           "password": "",
           "doris.request.retries": 1,
           "doris.request.read.timeout.ms": 10000,
           "doris.request.connect.timeout.ms": 10000,
           "query-port": 9030,
           "doris.request.query.timeout.s": 3600,
           "database": "seatunnel",
           "table": "example_tb_duplicate_key",
           "doris.deserialize.arrow.async": false,
           "doris.batch.size": 1024,
           "doris.exec.mem.limit": 2147483648
       }
     ],
     "sink": [
       {
           "plugin_name": "console"
       }
     ]
   }
   ```
   
   ### Running Command
   
   ```shell
   调用API运行任务
   ```
   
   ### Error Exception
   
   ```log
   [1019791029655568385] 2025-09-15 10:05:32,122 ERROR [o.a.s.e.s.d.p.PhysicalVertex  ] [hz.main.seaTunnel.task.thread-174] - Job (1019791029655568385), Pipeline: [(1/1)], task: [pipeline-1 [Source[0]-doris]-SourceTask (1/1)], taskGroupLocation: [TaskGroupLocation{jobId=1019791029655568385, pipelineId=1, taskGroupId=2}] end with state FAILED and Exception: java.lang.IllegalStateException: Memory was leaked by query. Memory leaked: (64)
   Allocator(ROOT) 0/64/64/2147483647 (res/actual/peak/limit)
   
   	at org.apache.seatunnel.shade.org.apache.arrow.memory.BaseAllocator.close(BaseAllocator.java:477)
   	at org.apache.seatunnel.shade.org.apache.arrow.memory.RootAllocator.close(RootAllocator.java:29)
   	at org.apache.seatunnel.connectors.seatunnel.common.source.arrow.reader.ArrowToSeatunnelRowReader.close(ArrowToSeatunnelRowReader.java:295)
   	at org.apache.seatunnel.connectors.seatunnel.common.source.arrow.reader.ArrowToSeatunnelRowReader.readArrow(ArrowToSeatunnelRowReader.java:117)
   	at org.apache.seatunnel.connectors.doris.source.reader.DorisValueReader.hasNext(DorisValueReader.java:241)
   	at org.apache.seatunnel.connectors.doris.source.reader.DorisSourceReader.pollNext(DorisSourceReader.java:90)
   	at org.apache.seatunnel.engine.server.task.flow.SourceFlowLifeCycle.collect(SourceFlowLifeCycle.java:159)
   	at org.apache.seatunnel.engine.server.task.SourceSeaTunnelTask.collect(SourceSeaTunnelTask.java:127)
   	at org.apache.seatunnel.engine.server.task.SeaTunnelTask.stateProcess(SeaTunnelTask.java:165)
   	at org.apache.seatunnel.engine.server.task.SourceSeaTunnelTask.call(SourceSeaTunnelTask.java:132)
   	at org.apache.seatunnel.engine.server.TaskExecutionService$BlockingWorker.run(TaskExecutionService.java:694)
   	at org.apache.seatunnel.engine.server.TaskExecutionService$NamedTaskWrapper.run(TaskExecutionService.java:1023)
   	at org.apache.seatunnel.api.tracing.MDCRunnable.run(MDCRunnable.java:43)
   	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
   	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
   	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
   	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
   	at java.base/java.lang.Thread.run(Thread.java:842)
   ```
   
   ### Zeta or Flink or Spark Version
   
   _No response_
   
   ### Java or Scala Version
   
   _No response_
   
   ### Screenshots
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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.apache.org

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


Re: [I] 使用Doris连接器读取数据时报内存泄漏异常 [seatunnel]

Posted by "wanglihui-git (via GitHub)" <gi...@apache.org>.
wanglihui-git commented on issue #9863:
URL: https://github.com/apache/seatunnel/issues/9863#issuecomment-3302052935

   试试在config/jvm_xxx里面加上 --add-opens=java.base/java.nio=ALL-UNNAMED 


-- 
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: [I] 使用Doris连接器读取数据时报内存泄漏异常 [seatunnel]

Posted by "pmx0117 (via GitHub)" <gi...@apache.org>.
pmx0117 commented on issue #9863:
URL: https://github.com/apache/seatunnel/issues/9863#issuecomment-3314994412

   > Can you provide detailed information? Specific version number, amount of data, and how long it has been running for the problem to occur.
   
   2.3.11版本
   数据很少只有几千条
   任务刚开始执行就报错


-- 
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: [I] 使用Doris连接器读取数据时报内存泄漏异常 [seatunnel]

Posted by "pmx0117 (via GitHub)" <gi...@apache.org>.
pmx0117 commented on issue #9863:
URL: https://github.com/apache/seatunnel/issues/9863#issuecomment-3311573331

   env {
     parallelism = "1"
     job.mode = "BATCH"
   }
   
   source {
     Jdbc {
       url = "jdbc:mysql://172.16.48.50:9030/ods"
       driver = "com.mysql.cj.jdbc.Driver"
       user = "root"
       password = "xxxx"
       query = """
         select di.platform_sku_code,
       """
     }
   }
   
   transform {
   }
   
   sink {
     Doris {
       fenodes = "172.16.48.50:8030"
       username = "root"
       password = "xxx"
     }
   }
   
   source换mysql连接器 https://seatunnel.apache.org/zh-CN/docs/2.3.11/connector-v2/source/Mysql


-- 
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: [I] 使用Doris连接器读取数据时报内存泄漏异常 [seatunnel]

Posted by "pmx0117 (via GitHub)" <gi...@apache.org>.
pmx0117 commented on issue #9863:
URL: https://github.com/apache/seatunnel/issues/9863#issuecomment-3301094846

   你好,我也遇到了这个问题,这个问题有解决方案吗


-- 
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: [I] Memory leak exception occurs when reading data with the Doris connector [seatunnel]

Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on issue #9863:
URL: https://github.com/apache/seatunnel/issues/9863#issuecomment-4569803842

   Thanks for the stack trace and config. From the current report, this does not look like a simple usage issue.
   
   The failure is happening in the shared Arrow reader cleanup path:
   - `ArrowToSeatunnelRowReader.readArrow(...)`
   - `ArrowToSeatunnelRowReader.close(...)`
   - `RootAllocator.close(...)`
   
   That is very close to the newer StarRocks source issue #10930, and the open fix PR #10931 is currently modifying that same common reader class rather than a StarRocks-only path.
   
   So at this point, this Doris issue appears closely related to #10930 instead of being an isolated Doris-specific failure.
   
   Please note that this project tracks issues in English. If you add follow-up details later, please try to provide them in English so more maintainers can review them directly.
   
   For now, the most useful next check will be: once PR #10931 is merged, please verify whether a build containing that change also fixes the Doris path. If it still reproduces after that, please update this thread with the new stack trace and exact build information, because that would mean there is still a Doris-specific leak path left.


-- 
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: [I] 使用Doris连接器读取数据时报内存泄漏异常 [seatunnel]

Posted by "pmx0117 (via GitHub)" <gi...@apache.org>.
pmx0117 commented on issue #9863:
URL: https://github.com/apache/seatunnel/issues/9863#issuecomment-3311583991

   > > > 你好,我也遇到了这个问题,这个问题有解决方案吗
   > > 
   > > 
   > > 我换成JDBC驱动可以了
   > 
   > 换成哪个版本的驱动呀?
   
   
   env {
     parallelism = "1"
     job.mode = "BATCH"
   }
   
   source {
     Jdbc {
       url = "jdbc:mysql://172.16.48.50:9030/ods"
       driver = "com.mysql.cj.jdbc.Driver"
       user = "root"
       password = "xxxx"
       query = """
         select di.platform_sku_code,
       """
     }
   }
   
   transform {
   }
   
   sink {
     Doris {
       fenodes = "172.16.48.50:8030"
       username = "root"
       password = "xxx"
     }
   }
   
   source换mysql连接器 https://seatunnel.apache.org/zh-CN/docs/2.3.11/connector-v2/source/Mysql
   驱动用的mysql-connector-j-8.0.33.jar


-- 
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: [I] 使用Doris连接器读取数据时报内存泄漏异常 [seatunnel]

Posted by "zhangshenghang (via GitHub)" <gi...@apache.org>.
zhangshenghang commented on issue #9863:
URL: https://github.com/apache/seatunnel/issues/9863#issuecomment-3314208149

   Can you provide detailed information? Specific version number, amount of data, and how long it has been running for the problem to occur.


-- 
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: [I] 使用Doris连接器读取数据时报内存泄漏异常 [seatunnel]

Posted by "angkorthomwdd (via GitHub)" <gi...@apache.org>.
angkorthomwdd commented on issue #9863:
URL: https://github.com/apache/seatunnel/issues/9863#issuecomment-3301455543

   > > 你好,我也遇到了这个问题,这个问题有解决方案吗
   > 
   > 我换成JDBC驱动可以了
   
   换成哪个版本的驱动呀?


-- 
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: [I] 使用Doris连接器读取数据时报内存泄漏异常 [seatunnel]

Posted by "pmx0117 (via GitHub)" <gi...@apache.org>.
pmx0117 commented on issue #9863:
URL: https://github.com/apache/seatunnel/issues/9863#issuecomment-3301213780

   > 你好,我也遇到了这个问题,这个问题有解决方案吗
   
   我换成JDBC驱动可以了


-- 
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: [I] Memory leak exception occurs when reading data with the Doris connector [seatunnel]

Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on issue #9863:
URL: https://github.com/apache/seatunnel/issues/9863#issuecomment-5125124916

   There is now concrete follow-up progress on this issue.
   
   A draft fix PR has been opened as #11593, and it is targeting the shared Arrow reader cleanup path that this Doris failure goes through. The current fix direction is to release the Arrow stream reader and related owned resources before closing the allocator, which matches the leak pattern described earlier in this thread.
   
   So at this point, this issue is no longer only waiting for more symptoms. It is being tracked through an actual code fix on `dev`.
   
   The next practical step is:
   1. let #11593 finish review and CI;
   2. once a build containing that change is available, verify whether your Doris job no longer fails with the same memory-leak exception;
   3. if it still reproduces after that, please update this thread with the new stack trace and exact build information, because that would indicate there is still a Doris-specific path beyond the shared Arrow reader cleanup.
   
   Also, since this project tracks issues in English, please try to provide any follow-up details in English if possible.


-- 
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: [I] 使用Doris连接器读取数据时报内存泄漏异常 [seatunnel]

Posted by "angkorthomwdd (via GitHub)" <gi...@apache.org>.
angkorthomwdd commented on issue #9863:
URL: https://github.com/apache/seatunnel/issues/9863#issuecomment-3301453481

   > > 你好,我也遇到了这个问题,这个问题有解决方案吗
   > 
   > 我换成JDBC驱动可以了
   
   换成哪个版本的驱动呀?


-- 
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: [I] Memory leak exception occurs when reading data with the Doris connector [seatunnel]

Posted by "davidzollo (via GitHub)" <gi...@apache.org>.
davidzollo commented on issue #9863:
URL: https://github.com/apache/seatunnel/issues/9863#issuecomment-6376335454

   Closing this issue as completed after rechecking the original report and its resolution.
   
   The allocator cleanup ordering in the shared Arrow reader has been corrected: the stream reader and its owned resources are released before the allocator, including the exceptional cleanup path. This matches the Arrow cleanup leak in the supplied Doris trace.
   
   Resolution evidence:
   
   - [PR #11929](https://github.com/apache/seatunnel/pull/11929), merged into `dev` on 2026-10-17 ([merge commit `4a6f0fe82964`](https://github.com/apache/seatunnel/commit/4a6f0fe82964f430877bc8b689e2ed75883d9136)).
   
   The corresponding implementation remains present in [`dev` at `14a27ac26a0a`](https://github.com/apache/seatunnel/commit/14a27ac26a0a71b56722f86cdf8ec2779094ceaf).
   
   This closes the matched shared-reader cleanup defect, rather than every possible Doris or Arrow memory failure.
   
   <!-- seatunnel-closure-audit:20261023:9863 -->


-- 
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: [I] Memory leak exception occurs when reading data with the Doris connector [seatunnel]

Posted by "davidzollo (via GitHub)" <gi...@apache.org>.
davidzollo closed issue #9863: Memory leak exception occurs when reading data with the Doris connector
URL: https://github.com/apache/seatunnel/issues/9863


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