-
Notifications
You must be signed in to change notification settings - Fork 635
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
mvn initialize docker:start stuck #862
Comments
As I see, you are running on Windows. Do you use Docker for Windows here ? Any chance that you could share your project (pom.xml). TBH, its always hard for me to check Windows issues and it takes a fair amount of time to get and update my Window environment. I hope I can tackle the issue ASAP, but I can't promise anything as I'm currently super busy with other works. |
Hi Roland, I've created a very simple project demonstrating this error. Have a look on: https://github.com/novityFS/docker-maven-plugin-waitlog-scenario The readme will give you more detailed info. I've analyzed that the error is not with the I also think that it's not a race condition. For this reason I've created an alternative version of the https://github.com/novityFS/docker-maven-plugin I can only guess, that the error may be with the Kind regards, Frank. |
Dear Roland, with my projects mentioned above I was able to get some light here. After rearranging the thread synchronisation of the The problem is this piece of code in the method try (InputStream is = response.getEntity().getContent()) {
while (true) {
if (!readStreamFrame(is)) {
return;
}
}
} catch (IOException e) {
callback.error("Cannot process chunk response: " + e);
finish();
} catch (LogCallback.DoneException e) {
// Can be thrown by a log callback which indicates that we are done.
finish();
} The
As you can see, the close operation tries to read the next chunk from the input stream. As there is no input left to read at that time, the IO-blocking causes the thread to hang and wait forever for new input from the stream. The main thread is then blocked as well, because it waits on the lock-object used to synchronise the external Why the Apache chunked-stream thinks, there is still some input to read? I don't know. Also there is a workaround using the following code in private void parseResponse(HttpResponse response) throws LogCallback.DoneException, IOException {
final StatusLine status = response.getStatusLine();
if (status.getStatusCode() != 200) {
exception = new DockerAccessException("Error while reading logs (" + status + ")");
throw new LogCallback.DoneException();
}
final InputStream is = response.getEntity().getContent();
try {
while (true) {
if (!readStreamFrame(is)) {
return;
}
}
} finally {
if ((is != null) && (is.available() > 0)) {
is.close();
}
}
} Kind regards, Frank |
@novityFS awesome, thanks a lot for the research and investigation ! I'm going to dive into this later and try to make a release with a fix at the end of this weeks. Thanks a lot ! |
You can use my pull request, if you like. |
@novityFS sorry, still super busy. But Christmas is soon, with some spare time ;-) |
Using d-m-p 0.24.0 with this change, my builds with
However, without |
Ah, good data point. Let me check this later, too. |
when I am trying to start the container using mvn initialize docker:start it stucks does not proceed further.
I am able to create docker image with the same configuration and it push this image in local repo.
but after that when I try to start this it stucks.
mvn -v
) : 3.3.9Added debug file
debug.txt
Any pointers appreciated.
Thanks,
Vinayak
The text was updated successfully, but these errors were encountered: