-
Notifications
You must be signed in to change notification settings - Fork 26
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
Many jobs based on the same agent template produce many failed deployment #102
Conversation
sparsick
commented
Feb 14, 2022
- add workaround for unexpected NullPointerException
- improve logging
- tested manually in Azure with container, that use Private IP Addresses and Public IP Addresses
- fixes Many jobs based on the same agent template produce many failed deployment #101
- Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
- Ensure that the pull request title represents the desired changelog entry
- Please describe what you did
- Link to relevant issues in GitHub or Jira
- Link to relevant pull requests, esp. upstream and downstream changes
- Ensure you have provided tests - that demonstrates feature works or fixes the issue
- improve logging
boolean nullIsThrown; | ||
do { | ||
try { | ||
ip = azureResourceManager.containerGroups() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we check the ip address for null instead and then retry rather than handling a null pointer?
is it possible the IP hasn't been allocated yet? seems quite weird though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the NullPointerException is coming from Resource Manager internally
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
java.lang.NullPointerException
at com.azure.resourcemanager.containerinstance.implementation.ContainerGroupImpl.initializeChildrenFromInner(ContainerGroupImpl.java:217)
src/main/java/com/microsoft/jenkins/containeragents/aci/AciCloud.java
Outdated
Show resolved
Hide resolved
azureResourceManager.containerGroups().getByResourceGroup(resourceGroup, agent.getNodeName()); | ||
|
||
if (containerGroup.containers().containsKey(agent.getNodeName()) | ||
&& containerGroup.containers().get(agent.getNodeName()).instanceView().currentState().state() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we check the container for null instead and then retry rather than handling a null pointer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the NullPointerException is coming from Resource Manager internally
Co-authored-by: Tim Jacomb <[email protected]>
Have you tested this and it solves the issue? |
Yes, I tested it with both kind of container instances (private and public ip addresses) and it works like I expected. Logoutput for private IP Container usage:
Job output:
|
@timja I will open a new issue to remove this workaround when issue Azure/azure-sdk-for-java#27083 is fixed. |