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

[neeo] Excessive Thread Leak - HttpClient-*-SelectorManager #15563

Closed
morph166955 opened this issue Sep 8, 2023 · 7 comments · Fixed by #15571
Closed

[neeo] Excessive Thread Leak - HttpClient-*-SelectorManager #15563

morph166955 opened this issue Sep 8, 2023 · 7 comments · Fixed by #15571
Labels
bug An unexpected problem or unintended behavior of an add-on

Comments

@morph166955
Copy link
Contributor

morph166955 commented Sep 8, 2023

Moved from openhab/openhab-core#3794

What I believe to be the transport part of neeo seems to be creating threads such as:

"HttpClient-14819-SelectorManager" Id=38543 in RUNNABLE (running in native)
    at [email protected]/sun.nio.ch.EPoll.wait(Native Method)
    at [email protected]/sun.nio.ch.EPollSelectorImpl.doSelect(EPollSelectorImpl.java:118)
    at [email protected]/sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:129)
      - locked sun.nio.ch.Util$2@11af4028
      - locked sun.nio.ch.EPollSelectorImpl@13b07a12
    at [email protected]/sun.nio.ch.SelectorImpl.select(SelectorImpl.java:141)
    at platform/[email protected]/jdk.internal.net.http.HttpClientImpl$SelectorManager.run(HttpClientImpl.java:889)

And not closing them. This is eventually causing OH to run out of available space for threads. My last crash showed over 4000 similar threads. When neeo transport is not installed, I have 1 open HttpClient thread. Within a minute of adding it (after waiting a considerable time) I had over 500.

@morph166955 morph166955 added the bug An unexpected problem or unintended behavior of an add-on label Sep 8, 2023
@morph166955 morph166955 changed the title [neeo] Excessive Thread Leak [neeo] Excessive Thread Leak - HttpClient-*-SelectorManager Sep 9, 2023
@morph166955
Copy link
Contributor Author

morph166955 commented Sep 9, 2023

From what I can tell, the HttpRequest function seems to build the client but then never releases it. It should run on close() by AutoClosable but it never seems to actually do it...

@openhab-bot
Copy link
Collaborator

This issue has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/openhab-takes-2mins-to-stop/149375/13

@mherwege
Copy link
Contributor

I upgraded to the OH4.1 milestone yesterday and I am running into the same issue. I never had an issue before and I have been using the Neeo binding and io service for years. My thread count was always stable, and now suddenly rises like crazy. I have not been able to do much analysis yet, and won't have much time in the coming weeks, but there is definitely something that made this problem appear now.

@openhab-bot
Copy link
Collaborator

This issue has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/outofmemoryerror-after-migration-to-4-1-0-m1/149796/3

@mherwege
Copy link
Contributor

Moved from openhab/openhab-core#3794

There is a change in the distribution that is causing this, and not only for the Neeo binding and transport. See https://community.openhab.org/t/outofmemoryerror-after-migration-to-4-1-0-m1/149796/8.

@openhab-bot
Copy link
Collaborator

This issue has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/oh4-runs-out-of-memory/148699/10

@openhab-bot
Copy link
Collaborator

This issue has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/sony-devices-binding-for-oh3/124388/136

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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants