-
Notifications
You must be signed in to change notification settings - Fork 634
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
Race condition when starting container causes IndexOutOfBoundsException when binding ports #1446
Comments
Opened PR with retry logic to address, happy to receive and implement feedback on it. |
hi the code in the pr looks good to me, with the retry. but unfortunate it does not work correct :-(
i am happy to run it with more log information if you need. |
@git9999999 : Would appreciate if you could provide logs with |
Hmm, odd. Our stack traces are identical so im unsure why it's not working. I would suggest running with the Also, know this might sound stupid but if you have been locally installing ( |
hi here we go. i checked out the PR branch and changed the name of the version to 0.34-SNAPSHOT-FIX. the build it. i also updated this version in my projekt. so i am sure this is the right version of the plugin. mvn_clean_install_with_fixed_plugin_from_pr_8f0f0093.txt cheers |
So im not seeing that log message and the line indicated by the stack trace
which cant be throwing that exception. |
@git9999999: Do you have some reproducer project and steps we can try out to reproduce this issue? It can help @ewencluley to debug what's not working as expected. |
Alternatively here's a built version of my code. Pop that in your But also 100% happy to take a look at an example project if you can provide as suggested ^ |
Good Morning :-) |
Description
An intermittent issue can be seen when starting containers. It seems to be a race condition that is exacerbated when running maven with debug logging
-X
. Without the debug logging containers fail to start withThe full stack trace of the exception is:
When adding some logging to the maven plugin I can see that during the the
io.fabric8.maven.docker.model.ContainerDetails.createPortBindings
method call the ports will usually have some mappings like this:However sometimes the array of mapped ports will be empty, e.g.
This causes the exception as the array is expected to not be empty and the first element retrieved.
I believe the call to the api in
io.fabric8.maven.docker.service.RunService.updateMappedPortsAndAddresses
is sometimes returning this empty data for the port if called too early.The solution I would propose would be to retry the API call and the
createPortBindings
activity if an empty array is encountered.Info
mvn -v
) :mvn verify
with-X
flag.The text was updated successfully, but these errors were encountered: