java icon indicating copy to clipboard operation
java copied to clipboard

PortForwardResult does not expose methods to close WebSocketStreamHandler nor expose is state

Open SanjayVas opened this issue 3 years ago • 11 comments

Describe the bug PortForwardResult's underlying WebSocketStreamHandler will remain open unless the WebSocket is closed remotely. Furthermore, PortForwardResult's methods that return streams will throw an IllegalStateException if the handler is closed, but does not expose a way to check the handler state to avoid the exception.

This is related to #865 but more specific.

Client Version 16.0.0

Kubernetes Version 1.24.0

Java Version Java 11

To Reproduce Steps to reproduce the behavior:

  1. Call PortForward.forward
  2. Call getInputStream/getOutputStream on the result with try-with-resources pattern

Expected behavior

  1. There is a way to check the state to avoid an IllegalStateExeption, e.g. exposing WebSocketStreamHandler.state via PortForwardResult.
  2. There is a way to close the underlying WebSocketStreamHandle, e.g. having PortForwardResult implement AutoCloseable and closing the WebSocketStreamHandle on close.

Server (please complete the following information):

  • OS: Linux (Debian Bookworm)
  • Environment: KinD
  • Cloud: None

SanjayVas avatar Oct 20 '22 17:10 SanjayVas

We'd be happy to have a PR to extend support to cover this.

brendandburns avatar Oct 20 '22 17:10 brendandburns

@brendandburns I want to contribute on this issue, can you please suggest a way?

Harsh4902 avatar Feb 27 '23 04:02 Harsh4902

/assing

tmrpavan avatar Apr 10 '23 08:04 tmrpavan

/assign

tmrpavan avatar Apr 10 '23 08:04 tmrpavan

/assign

Krishhhnaa avatar Apr 10 '23 22:04 Krishhhnaa

i am new to open source contribution , i tried but it didn't work. If someone works on this please do take me with you as i'll try my best to understand and eventually will try to help.

Krishhhnaa avatar Apr 11 '23 00:04 Krishhhnaa

/assign I don't know much about java, but i know C. I would like to give it a try. new to open source. Will try my best.

ghost avatar Apr 17 '23 00:04 ghost

@brendandburns I don't know much right now. How much time do I have to resolve this Issue? Asked this to get an idea about how much time i have to learn.

ghost avatar Apr 17 '23 00:04 ghost

/assign

Coderayush13 avatar May 10 '23 17:05 Coderayush13

@SanjayVas, is this still available?

rukundob451 avatar Jun 30 '23 05:06 rukundob451

@rukundob451 Not sure what you mean by that question. If you're asking if it's still an issue, then yes. If you're asking whether the maintainers would be accepting of a PR to fix address it, I'm not the right person to ask. I'm just the person that filed the issue, not a maintainer of this repo.

SanjayVas avatar Jun 30 '23 17:06 SanjayVas