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

Unexpected error when calling waitForExit #47

Open
mihneagiurgea opened this issue Dec 7, 2020 · 5 comments
Open

Unexpected error when calling waitForExit #47

mihneagiurgea opened this issue Dec 7, 2020 · 5 comments

Comments

@mihneagiurgea
Copy link

mihneagiurgea commented Dec 7, 2020

Here's the issue that we're seeing:

ManagedProcess process = builder.build();
process.start();
process.waitForExit(); // Crashes the error below:

waitForExit fails with this:

Caused by: ch.vorburger.exec.ManagedProcessException: Asked to waitFor Program 
[/tmp/75968747865555/MysqlDB4j/base/bin/mysql, -uroot, --socket=/tmp/75968747865555/MysqlDB4j.33803.sock] 
(in working directory /tmp/75968747865555/MysqlDB4j/base), but it was never even start()'ed! |
  |   | at ch.vorburger.exec.ManagedProcess.assertWaitForIsValid(ManagedProcess.java:478)
  |   | at ch.vorburger.exec.ManagedProcess.waitForExitMaxMsWithoutLog(ManagedProcess.java:439) |  
  |   | at ch.vorburger.exec.ManagedProcess.waitForExit(ManagedProcess.java:418) |  
  |   | at com.airbnb.mysql4j.DB.run(DB.java:405) |  
[...]

This is failing randomly, at a rate of say 5%. Succeeds after retries.

Based on the comment from here:

// We now must give the system a say 100ms chance to run the background

... I suspect (without being able to prove this via a test) that what's happening is this, inside startExecute()

  1. executor.execute starts execution of something that will fail
  2. this.wait(100) returns with no error, but incorrectly fails to detect that the background thread has an error
  3. isAlive = watchDog.isWatching() correctly returns False, because the background thread has indeed failed
  4. waitForExit will call assertWaitForIsValid(), which throws because isAlive = False (from 3) and hasResult = False (from 2)
@vorburger
Copy link
Owner

@mihneagiurgea do you want to check if #96 from @cardamon might fix this problem?

@vorburger
Copy link
Owner

@mihneagiurgea if you are still seeing this with the new 3.1.5 I am about to release, I would welcome a PR to fix!

@vorburger
Copy link
Owner

@mosesn perhaps you would like to chime in here - do you know if this one can be closed? Still needs a fix?

@mosesn
Copy link
Contributor

mosesn commented May 14, 2023

I'm still working on the MariaDB4J upgrade–the SLF4J 2.x upgrade is incompatible with some of the versions of the other libraries we use (Spark, Dropwizard, etc) so it has been a bit of a slog. I'm hoping to merge it in soon, and I should be able to give you better feedback once that's done.

@vorburger
Copy link
Owner

@mosesn any news?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants