TisonKun commented on issue #10451: [FLINK-15086][client] Explictly close 
JobCluster in attach mode
URL: https://github.com/apache/flink/pull/10451#issuecomment-562442058
 
 
   Verified locally
   
   | | without patch | with patch |
   |-|--------------|-------------|
   | execute + detach | cluster correctly closed | cluster correctly closed |
   | execute + attach | cluster correctly closed | cluster correctly closed |
   | executeAsync + detach | cluster correctly closed | cluster correctly 
closed |
   | executeAsync + attach | **cluster doesn't closed** | cluster correctly 
closed |
   
   actually here we have some statements.
   
   1. executeAsync + detach: cluster will close itself on job finish, so the 
job client might cannot query the cluster before JobClient closed. but since it 
somehow means attach execution because you still communicate the job with job 
client but config `detach`, it is an undefined behavior. In this case, the 
recommended practice would be: fire `env.executeAsync` and forget it.
   2. executeAsync + attach:
     1) resource leak if user doesn't call `JobClient#close` in main method. OK 
we document it and highlight it. Now that the ownership of the cluster move to 
user program, he should take care of it.
     2) cluster shutdown before job finished. It happens if user doesn't wait 
for job result but close job client before job finished. The job client is the 
handle you talk with the job; if you release it, the job is an orphan so close 
it would be OK.
   
   TBH for streaming workload which doesn't have a result anyway, it doesn't 
matter we just fire & forget. And close it when needed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to