-
Notifications
You must be signed in to change notification settings - Fork 113
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
"System.Net.Sockets.SocketException (98): Address in use" exception during rolling deployment #1827
Comments
I have a similar issue: My processes crashed when it tried to make a gcdump. When it tried to restart the container it failed with this exception. I had to remove dotnet-monitor. |
We were not able to reproduce this issue with rolling deployments, but there is a suggested workaround, which is to use a unique socket address for each pod. This would look something like the sample below containers:
- name: itemsservice
image: <redacted>
ports:
- containerPort: 80
- containerPort: 9102
env:
- name: PODNAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: DOTNET_DiagnosticPorts
value: /diag/port-$(PODNAME)
- name: DiagnosticPort__EndpointName
####
env:
- name: PODNAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: DOTNETMONITOR_DiagnosticPort__ConnectionMode
value: Listen
- name: DOTNETMONITOR_DiagnosticPort__EndpointName
value: /diag/port-$(PODNAME) |
Thank you @wiktork! Will try that out 😊 |
We are hitting this issue as well but we are attempting to run dotnet-monitor as a daemonset so the suggested workaround will not work. |
@wiktork We are using /tmp/port.sock as Diagnostic port value and sharing the /tmp folder. If the folder only stays for the lifecycle of the pod how come, giving the pod name would work in this scenario. |
@joelnotified, is this issue resolved after appending the pod name or making it unique? |
I can't tell for sure. I haven't run into the issue again, but I haven't tested it that much either. Sorry. |
The "Address is use" issue should be fixed in the dotnet-monitor images that were released today: 6.2.2 and 7.0.0 Preview 7. |
I've got the following yaml configured for an application running in an AKS cluster, with dotnet-monitor as a sidecar. It runs fine, but during a rolling deployment (of a new application version), we got the following error:
System.Net.Sockets.SocketException (98): Address in use
. I'm attaching the logs as well.Not sure if this is actually reproduced on each rolling deployment. An engineer on my team notified me and removed dotnet-monitor, so I can't really test in under the same circumstances right now. I think the issue was that it actually prevented the old application instance to be removed.
Is this something you have seen or do you understand by the configuration what's going on? Looks like it's when it shutting down that it's actually getting the exception? 🤔
(I know we shouldn't use
--no-auth
and expose the port, but we're just evaluating it in a test environment right now)The text was updated successfully, but these errors were encountered: