[ 
https://issues.apache.org/jira/browse/FLINK-15156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17216824#comment-17216824
 ] 

Robert Metzger commented on FLINK-15156:
----------------------------------------

Thanks a lot for your answer.

1. You are right. Even if it would cost something, it is probably a cost that 
people are willing to pay for the platform stability.
2. Patch size is a good argument here, I agree. We could first introduce a 
custom SecurityManager that checks on the main() method. If we later find that 
other parts of Flink would benefit from it as well, we can re-use the 
infrastructure.
3. I originally created this ticket because a user seemed to have used a http 
library (probably company internal) that called System.exit() without logging 
before.
The reason why I'm hesitant to turn a System.exit() call into an exception is 
the severely different behavior of the system. Maybe users have libraries that 
intentionally kill the JVM process (to free up memory on the machine, return a 
certain exit code, ...).
I believe it's not a lot of effort to offer the three config options I've 
proposed.


Do you want to provide a pull request for this feature?

> Warn user if System.exit() is called in user code
> -------------------------------------------------
>
>                 Key: FLINK-15156
>                 URL: https://issues.apache.org/jira/browse/FLINK-15156
>             Project: Flink
>          Issue Type: Improvement
>          Components: Runtime / Coordination
>            Reporter: Robert Metzger
>            Priority: Minor
>              Labels: starter
>
> It would make debugging Flink errors easier if we would intercept and log 
> calls to System.exit() through the SecurityManager.
> A user recently had an error where the JobManager was shutting down because 
> of a System.exit() in the user code: 
> https://lists.apache.org/thread.html/b28dabcf3068d489f38399c456c80d48569fcdf74b15f8bb95d532d0%40%3Cuser.flink.apache.org%3E
> If I remember correctly, we had such issues before.
> I put this ticket into the "Runtime / Coordination" component, as it is 
> mostly about improving the usability / debuggability in that area.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to