[ https://issues.apache.org/jira/browse/FLINK-31092?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17695584#comment-17695584 ]
Shengkai Fang edited comment on FLINK-31092 at 3/2/23 9:31 AM: --------------------------------------------------------------- After discussing with [~lsy] , I think we get why the behavior is not expected on the Gateway side. It's because of the wrong usage of the `FutureTask` in line [Operation:377|https://github.com/apache/flink/blob/9201f1e3684b130c3d665114f28208f248848b46/flink-table/flink-sql-gateway/src/main/java/org/apache/flink/table/gateway/service/operation/OperationManager.java#L377]. {{{}FutureTask#cancel{}}} doesn't promise the cancel the execution of the running thread by force[1]. {{FutureTask}} only interrupts the worker thread and then invokes the {{FutureTask#done}}. The {{FutureTask#done}} notifies the Gateway that all tasks are finished and ready to release used resources in the failed test. I will open a fix about this soon. [1] https://stackoverflow.com/questions/11158454/future-task-of-executorservice-not-truly-cancelling was (Author: fsk119): After discussing with [~lsy] , I think we get why the behavior is not expected on the Gateway side. It's because of the wrong usage of the `FutureTask` in line [Operation:377|https://github.com/apache/flink/blob/9201f1e3684b130c3d665114f28208f248848b46/flink-table/flink-sql-gateway/src/main/java/org/apache/flink/table/gateway/service/operation/OperationManager.java#L377]. {{{}FutureTask#cancel{}}} doesn't promise the cancel the execution of the running thread by force. {{FutureTask}} only interrupts the worker thread and then invokes the {{FutureTask#done}}. The {{FutureTask#done}} notifies the Gateway that all tasks are finished and ready to release used resources in the failed test. I will open a fix about this soon. > Hive ITCases fail with OutOfMemoryError > --------------------------------------- > > Key: FLINK-31092 > URL: https://issues.apache.org/jira/browse/FLINK-31092 > Project: Flink > Issue Type: Bug > Components: Connectors / Hive > Affects Versions: 1.17.0 > Reporter: Matthias Pohl > Assignee: luoyuxia > Priority: Blocker > Labels: test-stability > Attachments: > -__w-2-s-flink-connectors-flink-connector-hive-target-surefire-reports-2023-02-15T05-01-18_982-jvmRun4.dump, > VisualVM-FLINK-31092.png > > > We're experiencing a OutOfMemoryError where the heap space reaches the upper > limit: > https://dev.azure.com/apache-flink/apache-flink/_build/results?buildId=46161&view=logs&j=fc5181b0-e452-5c8f-68de-1097947f6483&t=995c650b-6573-581c-9ce6-7ad4cc038461&l=23142 > {code} > Feb 15 05:05:14 [INFO] Running > org.apache.flink.table.catalog.hive.HiveCatalogITCase > Feb 15 05:05:17 [INFO] java.lang.OutOfMemoryError: Java heap space > Feb 15 05:05:17 [INFO] Dumping heap to java_pid9669.hprof ... > Feb 15 05:05:28 [INFO] Heap dump file created [1957090051 bytes in 11.718 > secs] > java.lang.OutOfMemoryError: Java heap space > at > org.apache.maven.surefire.booter.ForkedBooter.cancelPingScheduler(ForkedBooter.java:209) > at > org.apache.maven.surefire.booter.ForkedBooter.acknowledgedExit(ForkedBooter.java:419) > at > org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:186) > at > org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:562) > at > org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:548) > {code} -- This message was sent by Atlassian Jira (v8.20.10#820010)