Skip to content
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

terminate java gateway on exit #231

Merged

Conversation

rstanchak
Copy link
Contributor

I ran into a situation running the iso15118 stack where the java background process spawned by JavaGateway was not getting terminated under certain conditions.

The issue can be replicated as follows:

  1. run evcc demo
  2. kill the top level python process with -9
    => the java process remains

I ran into this issue while using a unit test framework and ended up with 100s of java processes running in the background which eventually used up all my RAM.

This patch fixes the issue for me both in the unit test framework and when force-killing the parent process. The die_on_exit argument causes the die-on-broken-pipe flag to be passed to the java gateway, which terminates the gateway if the stdin pipe is broken.

@shalinnijel2 shalinnijel2 force-pushed the hotfix/terminate-java-gateway branch from a30c534 to 151316c Compare May 22, 2023 17:31
@shalinnijel2
Copy link
Contributor

I gave it a quick check and my end and saw it working. Thank you for your contribution @rstanchak

@shalinnijel2 shalinnijel2 merged commit bb18245 into EcoG-io:master May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants