-
Notifications
You must be signed in to change notification settings - Fork 182
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
Exception during conversion can make the process hang #791
Comments
Our original assumption was that if the container has exited, the conversion process should immediately exit as well, maybe with some small delay for some cleanups. So, we originally attributed this to a race condition. We have noticed this happening in case of successful conversions, where indeed it's due to a race condition. If we wait a tiny bit before checking the conversion process' status, we will see that it has stopped. Things are very different in the case of failed conversions due to exceptions in the host. In that case, what happens is:
|
Now that we know what's going on behind the scenes, let's answer the above questions:
That's because the conversion process may still linger, until the parent has read all the data that the container has written.
The conversion process remains stuck, because the container has written lots of data to the stdout, and the host process has not read them. |
How can we improve here? We can do the following:
|
Gracefully terminate certain conversion processes that may get stuck when writing lots of data to stdout. Also, handle a race condition when a conversion process terminates slightly after the associated container. Fixes #791
Gracefully terminate certain conversion processes that may get stuck when writing lots of data to stdout. Also, handle a race condition when a conversion process terminates slightly after the associated container. Fixes #791
While performing our QA tests for 0.6.1 on Windows, we tested some success and error cases, to see how our termination logic (see #749 and #772) works for them. Below are the logs for each run:
Successful conversion
Failed conversion by the conversion process
Failed conversion by the host
Two main things are of note here:
docker run ...
) still exists.The text was updated successfully, but these errors were encountered: