Skip to content
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

java.net.SocketException: Connection or outbound has been closed #3385

Open
tporeba opened this issue May 6, 2024 · 3 comments
Open

java.net.SocketException: Connection or outbound has been closed #3385

tporeba opened this issue May 6, 2024 · 3 comments
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@tporeba
Copy link

tporeba commented May 6, 2024

Describe the bug
When doing more complex kubectl exec calls using the example code based on https://github.com/kubernetes-client/java/blob/master/examples/examples-release-latest/src/main/java/io/kubernetes/client/examples/ExecExample.java I am very often observing an exception

   java.net.SocketException: Connection or outbound has been closed
    	at sun.security.ssl.SSLSocketOutputRecord.deliver(SSLSocketOutputRecord.java:267)
    	at sun.security.ssl.SSLSocketImpl$AppOutputStream.write(SSLSocketImpl.java:1193)
    	at okio.OutputStreamSink.write(JvmOkio.kt:56)
    	at okio.AsyncTimeout$sink$1.write(AsyncTimeout.kt:102)
    	at okio.RealBufferedSink.flush(RealBufferedSink.kt:268)
    	at okhttp3.internal.ws.WebSocketWriter.writeControlFrame(WebSocketWriter.kt:142)
    	at okhttp3.internal.ws.WebSocketWriter.writeClose(WebSocketWriter.kt:102)
    	at okhttp3.internal.ws.RealWebSocket.writeOneFrame$okhttp(RealWebSocket.kt:533)
    	at okhttp3.internal.ws.RealWebSocket$WriterTask.runOnce(RealWebSocket.kt:620)
    	at okhttp3.internal.concurrent.TaskRunner.runTask(TaskRunner.kt:116)
    	at okhttp3.internal.concurrent.TaskRunner.access$runTask(TaskRunner.kt:42)
    	at okhttp3.internal.concurrent.TaskRunner$runnable$1.run(TaskRunner.kt:65)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    	at java.lang.Thread.run(Thread.java:750)

It still works, it doesn't break the call, but it is very annoying and unnecessarily attracts attention when looking at the logs from the tool.

Client Version
20.0.0

Kubernetes Version
e.g. 1.26.5

Java Version
Java 8

To Reproduce
Steps to reproduce the behavior:
Run the code from https://github.com/kubernetes-client/java/blob/master/examples/examples-release-latest/src/main/java/io/kubernetes/client/examples/ExecExample.java couple of times.

Expected behavior
Exception should not be thrown.

Additional context
This was already reported in #1891 , #1923 but wasn't fixed. Maybe this time?

@brendandburns
Copy link
Contributor

I think that you need to set the unhandled exception handler here:

https://github.com/kubernetes-client/java/blob/master/util/src/main/java/io/kubernetes/client/Exec.java#L110

And if you do that, you should be able to supress this logging.

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 4, 2024
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle rotten
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

4 participants