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

[DenonMarantz] Telnet Thread Issue #9494

Closed
morph166955 opened this issue Dec 23, 2020 · 4 comments · Fixed by #9511
Closed

[DenonMarantz] Telnet Thread Issue #9494

morph166955 opened this issue Dec 23, 2020 · 4 comments · Fixed by #9511
Assignees
Labels
bug An unexpected problem or unintended behavior of an add-on PR pending There is a pull request for resolving the issue

Comments

@morph166955
Copy link
Contributor

Opening as per @kaikreuzer from openhab/openhab-core#1998

It permanently blocks one thread from the thread pool as it uses it to listen to a telnet connection. It should use its own thread instead of the shared thread pool for that.

"OH-thingHandler-2" #226 daemon prio=5 os_prio=0 cpu=76.63ms elapsed=3419.19s tid=0x00007fbd1402c000 nid=0x40cdb runnable  [0x00007fbd00825000]
   java.lang.Thread.State: RUNNABLE
	at java.net.SocketInputStream.socketRead0([email protected]/Native Method)
	at java.net.SocketInputStream.socketRead([email protected]/SocketInputStream.java:115)
	at java.net.SocketInputStream.read([email protected]/SocketInputStream.java:168)
	at java.net.SocketInputStream.read([email protected]/SocketInputStream.java:140)
	at sun.nio.cs.StreamDecoder.readBytes([email protected]/StreamDecoder.java:284)
	at sun.nio.cs.StreamDecoder.implRead([email protected]/StreamDecoder.java:326)
	at sun.nio.cs.StreamDecoder.read([email protected]/StreamDecoder.java:178)
	- locked <0x00000000c45000f0> (a java.io.InputStreamReader)
	at java.io.InputStreamReader.read([email protected]/InputStreamReader.java:185)
	at java.io.BufferedReader.fill([email protected]/BufferedReader.java:161)
	at java.io.BufferedReader.readLine([email protected]/BufferedReader.java:326)
	- locked <0x00000000c45000f0> (a java.io.InputStreamReader)
	at java.io.BufferedReader.readLine([email protected]/BufferedReader.java:392)
	at org.openhab.binding.denonmarantz.internal.connector.telnet.DenonMarantzTelnetClient.run(DenonMarantzTelnetClient.java:71)
@morph166955 morph166955 added the bug An unexpected problem or unintended behavior of an add-on label Dec 23, 2020
@jwveldhuis jwveldhuis self-assigned this Dec 24, 2020
@jwveldhuis
Copy link
Contributor

Will have a look at this.

jwveldhuis added a commit to jwveldhuis/openhab-addons that referenced this issue Dec 24, 2020
@jwveldhuis
Copy link
Contributor

@morph166955 can you review my change, is this what you meant?

@jwveldhuis jwveldhuis added the PR pending There is a pull request for resolving the issue label Dec 24, 2020
@morph166955
Copy link
Contributor Author

I'll defer to @kaikreuzer. I was just copy/pasting his comments from the original issue.

J-N-K pushed a commit that referenced this issue Dec 26, 2020
* Run the Telnet socket in a dedicated thread, not from the shared thread pool.
Fixes #9494
Signed-off-by: Jan-Willem Veldhuis <[email protected]>
@morph166955
Copy link
Contributor Author

morph166955 commented Dec 26, 2020

I pulled and compiled a jar to test this after #9511 was merged. Ran a thread dump. Output below.

"OH-binding-denonmarantz:avr:removed" #609800 prio=5 os_prio=0 cpu=3.85ms elapsed=414.99s tid=0x00007f766999b800 nid=0x18e929 runnable  [0x00007f7637a94000]
   java.lang.Thread.State: RUNNABLE
        at java.net.SocketInputStream.socketRead0([email protected]/Native Method)
        at java.net.SocketInputStream.socketRead([email protected]/SocketInputStream.java:115)
        at java.net.SocketInputStream.read([email protected]/SocketInputStream.java:168)
        at java.net.SocketInputStream.read([email protected]/SocketInputStream.java:140)
        at sun.nio.cs.StreamDecoder.readBytes([email protected]/StreamDecoder.java:284)
        at sun.nio.cs.StreamDecoder.implRead([email protected]/StreamDecoder.java:326)
        at sun.nio.cs.StreamDecoder.read([email protected]/StreamDecoder.java:178)
        - locked <0x00000000dd407b48> (a java.io.InputStreamReader)
        at java.io.InputStreamReader.read([email protected]/InputStreamReader.java:185)
        at java.io.BufferedReader.fill([email protected]/BufferedReader.java:161)
        at java.io.BufferedReader.readLine([email protected]/BufferedReader.java:326)
        - locked <0x00000000dd407b48> (a java.io.InputStreamReader)
        at java.io.BufferedReader.readLine([email protected]/BufferedReader.java:392)
        at org.openhab.binding.denonmarantz.internal.connector.telnet.DenonMarantzTelnetClientThread.run(DenonMarantzTelnetClientThread.java:69)

   Locked ownable synchronizers:
        - None


seaside1 pushed a commit to seaside1/openhab-addons that referenced this issue Dec 28, 2020
)

* Run the Telnet socket in a dedicated thread, not from the shared thread pool.
Fixes openhab#9494
Signed-off-by: Jan-Willem Veldhuis <[email protected]>
seaside1 pushed a commit to seaside1/openhab-addons that referenced this issue Dec 28, 2020
)

* Run the Telnet socket in a dedicated thread, not from the shared thread pool.
Fixes openhab#9494
Signed-off-by: Jan-Willem Veldhuis <[email protected]>
Signed-off-by: Joseph Hagberg <[email protected]>
thinkingstone pushed a commit to thinkingstone/openhab-addons that referenced this issue Nov 7, 2021
)

* Run the Telnet socket in a dedicated thread, not from the shared thread pool.
Fixes openhab#9494
Signed-off-by: Jan-Willem Veldhuis <[email protected]>
marcfischerboschio pushed a commit to bosch-io/openhab-addons that referenced this issue May 5, 2022
)

* Run the Telnet socket in a dedicated thread, not from the shared thread pool.
Fixes openhab#9494
Signed-off-by: Jan-Willem Veldhuis <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on PR pending There is a pull request for resolving the issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants