zjureel edited a comment on pull request #18007: URL: https://github.com/apache/flink/pull/18007#issuecomment-987597330
@KarmaGYZ Thank you for your comments. I think it's a good question about `ScheduledMainThreadExecutor` and `MainThreadExecutor`. I create `ScheduledMainThreadExecutor` here for two reasons: 1) The `ScheduledMainThreadExecutor` instance is not only created and used in `RpcEndpoint`, but also created in `HeartbeatManager.monitorTarget` for each job in `TaskExecutor` to schedule the job's heartbeat later. When a job terminates, its `ScheduledMainThreadExecutor` should be closed too. 2) In my conception, `MainThreadExecutor#schedule` will be replaced with `ScheduledMainThreadExecutor` and it will throw `Exception` when all its calls are replaced. The `MainThreadExecutor` will be used as main thread to execute `Runnable` at once. WDYT of that? THX -- 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]
