-
Notifications
You must be signed in to change notification settings - Fork 13.8k
[FLINK-2512]Add client.close() before throw RuntimeException #1009
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
I think the best thing would be to just move the |
|
@uce Thanks. What about remove "if(client.getTopologyJobId(name) != null) {...}" in line 103, because submitTopologyWithOpts() has check it at the head of function and will throw AlreadyAliveException.Then in finally{} close client. |
|
If you move the try up, you can certainly remove the manual close. Regarding the check in 103, it really depends on whether the Strom compat layer depends on having only a single job per client. Therefore I would keep it in and let it throw the RuntimeException as before. The finally block will then make sure that the client is closed. |
|
Since |
|
Looks good, will merge this... |
|
All builds are failing though, not sure if bc this patch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't declaration of client be outside of the try clause?
|
You are right, CI caught it. From my skimming over, the code looked good, but it does not compile... |
|
@hsaputra @StephanEwen Thanks. I have fix my code error. |
|
+1 |
…d in FlinkSubmitter This closes apache#1009
In line 129, it close client in finally{} before throw exception.
But in line 105, it throw exception without close client.
So I think it is better to close client before throw RuntimeException.