Martijn Visser created FLINK-41077:
--------------------------------------

             Summary: RpcEndpoint.MainThreadExecutor#schedule swallows 
exceptions thrown by the scheduled task
                 Key: FLINK-41077
                 URL: https://issues.apache.org/jira/browse/FLINK-41077
             Project: Flink
          Issue Type: Bug
          Components: Runtime / RPC
    Affects Versions: 2.2.1, 2.3.0, 1.20.6, 2.4.0
            Reporter: Martijn Visser
            Assignee: Martijn Visser


{{RpcEndpoint.MainThreadExecutor#schedule}} wraps the task in a {{FutureTask}} 
and runs that in the main thread. {{FutureTask#run}} catches every 
{{Throwable}}, so an exception thrown by a scheduled task is stored in the 
returned future and never reaches {{PekkoRpcActor#handleRunAsync}}, which logs 
failures of {{execute()}}-submitted runnables and rethrows fatal errors. A 
scheduled task that throws, including an {{OutOfMemoryError}}, is silent unless 
the caller calls {{get()}} on the returned future, and no in-tree caller does: 
{{HeartbeatManagerSenderImpl}} (a throwing heartbeat tick ends the heartbeat 
loop with no log line), {{DefaultBlocklistHandler}}, 
{{DeclarativeSlotPoolBridge}}, {{DefaultDeclarativeSlotPool}}, 
{{PhysicalSlotRequestBulkCheckerImpl}}, {{ExecutionTimeBasedSlowTaskDetector}}, 
{{AdaptiveScheduler}}, and the driver executor in {{ActiveResourceManager}}. 
{{schedule()}} should surface the failure to the actor the same way 
{{execute()}} does while keeping it in the returned future. After the change a 
fatal error in any of these tasks exits the JVM like one in an 
{{execute()}}-submitted runnable does today.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to