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

Websocket connection could not be stopped properly #607

Closed
cweitkamp opened this issue Jan 5, 2019 · 7 comments
Closed

Websocket connection could not be stopped properly #607

cweitkamp opened this issue Jan 5, 2019 · 7 comments

Comments

@cweitkamp
Copy link
Contributor

After restarting the bundle (version current snapshot build 1487) or disposing the Bridge handler I got this message with the following warnings all day long.

@davidgraeff Any thoughts?

2019-01-05 08:57:46.893 [WARN ] [e.jetty.util.thread.QueuedThreadPool] - QueuedThreadPool[ESH-httpClient--deconz-001788151452]@a643c7{STOPPING,5<=6<=10,i=0,q=1}[org.eclipse.jetty.util.thread.TryExecutor$$Lambda$116/20842820@f20066] Couldn't stop Thread[ESH-httpClient--deconz-001788151452-46619,5,main]
2019-01-05 08:57:46.897 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler DeconzBridgeHandler tried updating the thing status although the handler was already disposed.
2019-01-05 08:57:46.903 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler DeconzBridgeHandler tried updating the thing status although the handler was already disposed.
2019-01-05 08:57:46.905 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler DeconzBridgeHandler tried updating the thing status although the handler was already disposed.
2019-01-05 08:57:46.908 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler DeconzBridgeHandler tried updating the thing status although the handler was already disposed.
2019-01-05 08:57:51.501 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler DeconzBridgeHandler tried updating the thing status although the handler was already disposed.
2019-01-05 08:57:56.895 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler DeconzBridgeHandler tried updating the thing status although the handler was already disposed.
@wborn wborn changed the title [deconz] Webcocket connection could not be stopped properly [deconz] Websocket connection could not be stopped properly Jan 5, 2019
@Cyb4Black
Copy link

Got the bad boy in DeconzBridgeHandler.

scheduledFuture = scheduler.scheduleWithFixedDelay(this::startWebsocket, POLL_FREQUENCY_SEC, POLL_FREQUENCY_SEC, TimeUnit.SECONDS); at about line 221

this guy is never killed on dispose, so the objects stay all alive and try to keep working after disposing.
Will put this in my current rewrite 😉

@cweitkamp
Copy link
Contributor Author

Nice catch. I would prefer separate PRs for the fix and the rewrite. Can you do that?

Regarding the rewrite I will write my opinion in the other chat.

@davidgraeff
Copy link
Member

Any fix for this yet? A github online editor fix would be enough as a start.

@davidgraeff
Copy link
Member

I have looked into the code and did not find any obvious problem. The mentioned timer is stopped correctly in stopTimer and the websocket connection is closed and destroyed as well. Hm.

@cweitkamp
Copy link
Contributor Author

I consider this issue not being related to deCONZ. The number of warnings in my test environment increased. I am running OH Build 1535. This time no deCONZ. Only binding is Kodi, which uses the WebSocketFactory too. I will move this issue to openHAB 2 Core.

2019-02-25 17:16:33.425 [WARN ] [e.jetty.util.thread.QueuedThreadPool] - QueuedThreadPool[ESH-httpClient-common]@63de6d13{STOPPING,10<=10<=40,i=0,q=4}[org.eclipse.jetty.util.thread.TryExecutor$$Lambda$119/1335855201@5a0d8460] Couldn't stop Thread[ESH-httpClient-common-86,5,]
2019-02-25 17:16:33.427 [WARN ] [e.jetty.util.thread.QueuedThreadPool] - QueuedThreadPool[ESH-httpClient-common]@63de6d13{STOPPING,10<=10<=40,i=0,q=4}[org.eclipse.jetty.util.thread.TryExecutor$$Lambda$119/1335855201@5a0d8460] Couldn't stop Thread[ESH-httpClient-common-87,5,main]
2019-02-25 17:16:33.429 [WARN ] [e.jetty.util.thread.QueuedThreadPool] - QueuedThreadPool[ESH-httpClient-common]@63de6d13{STOPPING,10<=10<=40,i=0,q=4}[org.eclipse.jetty.util.thread.TryExecutor$$Lambda$119/1335855201@5a0d8460] Couldn't stop Thread[ESH-httpClient-common-88,5,main]
openhab> bundle:list
START LEVEL 100 , List Threshold: 50
 ID │ State  │ Lvl │ Version               │ Name
────┼────────┼─────┼───────────────────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 20 │ Active │  80 │ 5.3.1.201602281253    │ OSGi JAX-RS Connector
 21 │ Active │  80 │ 2.8.2.v20180104-1110  │ Gson: Google Json Library for Java
 22 │ Active │  80 │ 18.0.0                │ Guava: Google Core Libraries for Java
 23 │ Active │  80 │ 3.0.0.v201312141243   │ Google Guice (No AOP)
 27 │ Active │  80 │ 3.5.5                 │ JmDNS
 29 │ Active │  80 │ 1.0.0                 │ Units of Measurement API
 31 │ Active │  80 │ 1.1.0.Final           │ Bean Validation API
 33 │ Active │  80 │ 2.0.1                 │ javax.ws.rs-api
 34 │ Active │  80 │ 2.9.2                 │ Joda-Time
 35 │ Active │  80 │ 3.2.0.v201101311130   │ ANTLR Runtime
 38 │ Active │  80 │ 3.2.1                 │ Commons Collections
 39 │ Active │  80 │ 1.1                   │ Commons Exec
 40 │ Active │  80 │ 2.2.0                 │ Commons IO
 41 │ Active │  80 │ 2.6                   │ Commons Lang
 50 │ Active │  80 │ 4.2.2                 │ Apache Karaf :: OSGi Services :: Event
 65 │ Active │  80 │ 1.4.7.1               │ Apache ServiceMix :: Bundles :: xstream
 67 │ Active │  80 │ 4.6.0                 │ Apache XBean OSGI Bundle Utilities
 68 │ Active │  80 │ 4.6.0                 │ Apache XBean :: Classpath Resource Finder
 69 │ Active │  80 │ 2.12.0.v20160420-0247 │ EMF Common
 70 │ Active │  80 │ 2.12.0.v20160420-0247 │ EMF Ecore
 71 │ Active │  80 │ 2.11.0.v20160420-0247 │ EMF Change Model
 72 │ Active │  80 │ 2.12.0.v20160420-0247 │ EMF XML/XMI Persistence
 73 │ Active │  80 │ 3.8.0.v20160509-1230  │ Common Eclipse Runtime
 78 │ Active │  80 │ 9.4.11.v20180605      │ Jetty :: Http Utility
 85 │ Active │  80 │ 9.4.12.v20180830      │ Jetty :: Proxy
 97 │ Active │  80 │ 9.4.11.v20180605      │ Jetty :: Websocket :: Common
104 │ Active │  80 │ 0.4.1.v20180515-1321  │ org.eclipse.lsp4j
105 │ Active │  80 │ 0.4.1.v20180515-1321  │ org.eclipse.lsp4j.jsonrpc
106 │ Active │  80 │ 2.14.0.v20180522-1629 │ Xtend Runtime Library
107 │ Active │  80 │ 2.14.0.v20180522-1629 │ Xtend Macro Interfaces
108 │ Active │  80 │ 2.14.0.v20180522-1821 │ Xtext
109 │ Active │  80 │ 2.14.0.v20180522-1833 │ Xtext Common Types
110 │ Active │  80 │ 2.14.0.v20180522-1821 │ Xtext IDE Core
111 │ Active │  80 │ 2.14.0.v20180522-1821 │ Xtext Utility
112 │ Active │  80 │ 2.14.0.v20180522-1833 │ Xbase Model
113 │ Active │  80 │ 2.14.0.v20180522-1833 │ Xbase Generic IDE Services
114 │ Active │  80 │ 2.14.0.v20180522-1629 │ Xbase Runtime Library
129 │ Active │  80 │ 1.9.6                 │ MIME streaming extension
131 │ Active │  80 │ 6.2.0                 │ org.objectweb.asm
132 │ Active │  80 │ 6.2.0                 │ org.objectweb.asm.commons
133 │ Active │  80 │ 6.2.0                 │ org.objectweb.asm.tree
134 │ Active │  80 │ 2.5.0.201902220301    │ openHAB Core :: Bundles :: Core
135 │ Active │  80 │ 2.5.0.201902220302    │ openHAB Core :: Bundles :: Audio
136 │ Active │  80 │ 2.5.0.201902220308    │ openHAB Core :: Bundles :: OAuth2Client
137 │ Active │  80 │ 2.5.0.201902220308    │ openHAB Core :: Bundles :: Binding XML
138 │ Active │  90 │ 2.5.0.201902220307    │ openHAB Core :: Bundles :: Boot
139 │ Active │  80 │ 2.5.0.201902220301    │ openHAB Core :: Bundles :: Configuration Core
140 │ Active │  80 │ 2.5.0.201902220301    │ openHAB Core :: Bundles :: Configuration Discovery
141 │ Active │  80 │ 2.5.0.201902220309    │ openHAB Core :: Bundles :: Configuration mDNS Discovery
142 │ Active │  80 │ 2.5.0.201902220309    │ openHAB Core :: Bundles :: Configuration Dispatcher
143 │ Active │  75 │ 2.5.0.201902220308    │ openHAB Core :: Bundles :: Configuration XML
144 │ Active │  80 │ 2.5.0.201902220308    │ openHAB Core :: Bundles :: ID
145 │ Active │  80 │ 2.5.0.201902220301    │ openHAB Core :: Bundles :: Console
146 │ Active │  80 │ 2.5.0.201902220308    │ openHAB Core :: Bundles :: Console for OSGi runtime Karaf
147 │ Active │  80 │ 2.5.0.201902220302    │ openHAB Core :: Bundles :: HTTP Interface
149 │ Active │  80 │ 2.5.0.201902220308    │ openHAB Core :: Bundles :: Monitor
150 │ Active │  80 │ 2.5.0.201902220301    │ openHAB Core :: Bundles :: Network I/O
151 │ Active │  80 │ 2.5.0.201902220308    │ openHAB Core :: Bundles :: REST Interface
152 │ Active │  80 │ 2.5.0.201902220309    │ openHAB Core :: Bundles :: REST Interface
153 │ Active │  80 │ 2.5.0.201902220309    │ openHAB Core :: Bundles :: REST mDNS Announcer
154 │ Active │  80 │ 2.5.0.201902220309    │ openHAB Core :: Bundles :: REST JAX-RS Optimizations
155 │ Active │  80 │ 2.5.0.201902220309    │ openHAB Core :: Bundles :: Sitemap REST Interface
156 │ Active │  80 │ 2.5.0.201902220309    │ openHAB Core :: Bundles :: SSE Interface
157 │ Active │  80 │ 2.5.0.201902220309    │ openHAB Core :: Bundles :: Voice REST Interface
158 │ Active │  80 │ 2.5.0.201902220308    │ openHAB Core :: Bundles :: mDNS Service
159 │ Active │  80 │ 2.5.0.201902220308    │ openHAB Core :: Bundles :: Karaf Integration
160 │ Active │  80 │ 2.5.0.201902220301    │ openHAB Core :: Bundles :: Model Core
161 │ Active │  80 │ 2.5.0.201902220307    │ openHAB Core :: Bundles :: Model Items
162 │ Active │  80 │ 2.5.0.201902220310    │ openHAB Core :: Bundles :: Model Item IDE
163 │ Active │  80 │ 2.5.0.201902220310    │ openHAB Core :: Bundles :: Model Items Runtime
164 │ Active │  80 │ 2.5.0.201902220311    │ openHAB Core :: Bundles :: Language Server
165 │ Active │  80 │ 2.5.0.201902220302    │ openHAB Core :: Bundles :: Model Persistence
166 │ Active │  80 │ 2.5.0.201902220310    │ openHAB Core :: Bundles :: Model Persistence IDE
167 │ Active │  80 │ 2.5.0.201902220311    │ openHAB Core :: Bundles :: Model Persistence Runtime
168 │ Active │  80 │ 2.5.0.201902220304    │ openHAB Core :: Bundles :: Model Rules
169 │ Active │  80 │ 2.5.0.201902220310    │ openHAB Core :: Bundles :: Model Rule IDE
170 │ Active │  80 │ 2.5.0.201902220305    │ openHAB Core :: Bundles :: Model Rules Runtime
171 │ Active │  80 │ 2.5.0.201902220303    │ openHAB Core :: Bundles :: Model Script
172 │ Active │  80 │ 2.5.0.201902220310    │ openHAB Core :: Bundles :: Model Script IDE
173 │ Active │  80 │ 2.5.0.201902220311    │ openHAB Core :: Bundles :: Model Script Runtime
174 │ Active │  80 │ 2.5.0.201902220306    │ openHAB Core :: Bundles :: Model Sitemap
175 │ Active │  80 │ 2.5.0.201902220310    │ openHAB Core :: Bundles :: Model Sitemap IDE
176 │ Active │  80 │ 2.5.0.201902220311    │ openHAB Core :: Bundles :: Model Sitemap Runtime
177 │ Active │  80 │ 2.5.0.201902220311    │ openHAB Core :: Bundles :: Model Thing
178 │ Active │  80 │ 2.5.0.201902220311    │ openHAB Core :: Bundles :: Model Thing IDE
179 │ Active │  80 │ 2.5.0.201902220311    │ openHAB Core :: Bundles :: Model Thing Runtime
180 │ Active │  80 │ 2.5.0.201902220301    │ openHAB Core :: Bundles :: Persistence
181 │ Active │  80 │ 2.5.0.201902220301    │ openHAB Core :: Bundles :: Scheduler Service
182 │ Active │  80 │ 2.5.0.201902220308    │ openHAB Core :: Bundles :: Semantics
183 │ Active │  80 │ 2.5.0.201902220312    │ openHAB Core :: Bundles :: JSON Storage
184 │ Active │  80 │ 2.5.0.201902220301    │ openHAB Core :: Bundles :: Thing
185 │ Active │  75 │ 2.5.0.201902220308    │ openHAB Core :: Bundles :: Thing XML
186 │ Active │  80 │ 2.5.0.201902220302    │ openHAB Core :: Bundles :: Transformation Service
187 │ Active │  80 │ 2.5.0.201902220308    │ openHAB Core :: Bundles :: UI
188 │ Active │  80 │ 2.5.0.201902220311    │ openHAB Core :: Bundles :: UI Icon Support
189 │ Active │  80 │ 2.5.0.201902220302    │ openHAB Core :: Bundles :: Voice
190 │ Active │  80 │ 2.5.0.201902241632    │ openHAB Dashboard UI
197 │ Active │  80 │ 1.0.2                 │ Units of Measurement Common Library
198 │ Active │  80 │ 1.0.8                 │ Units of Measurement Implementation for Java SE
199 │ Active │  80 │ 2.5.0.201902110950    │ Kodi Binding
201 │ Active │  80 │ 1.6.0                 │ Commons Codec
202 │ Active │  80 │ 4.2.3                 │ Apache HttpClient OSGi bundle
203 │ Active │  80 │ 4.2.3                 │ Apache HttpCore OSGi bundle
204 │ Active │  80 │ 3.1.0.7               │ Apache ServiceMix :: Bundles :: commons-httpclient
205 │ Active │  80 │ 1.3.5.0               │ MariaDB JDBC Client
206 │ Active │  80 │ 1.14.0.201902230308   │ openHAB Mail Action
207 │ Active │  80 │ 2.5.0.201902220308    │ openHAB Core :: Bundles :: 1.x Compatibility Layer
208 │ Active │  80 │ 2.5.0.201902241742    │ openHAB Java Sound Support
209 │ Active │  80 │ 2.5.0.201902241742    │ Web Audio Support
210 │ Active │  80 │ 1.14.0.201902230308   │ openHAB JDBC SQL Persistence bundle
211 │ Active │  80 │ 1.14.0.201902230308   │ openHAB MapDB Persistence Bundle
212 │ Active │  75 │ 2.5.0.201902241742    │ JavaScript Transformation Service
213 │ Active │  75 │ 2.5.0.201902241742    │ Map Transformation Service
214 │ Active │  75 │ 2.5.0.201902241742    │ Scale Transformation Service
217 │ Active │  80 │ 2.5.0.201902241632    │ Paper UI
218 │ Active │  80 │ 2.5.1                 │ JUPnP Library
219 │ Active │  80 │ 2.5.0.201902220309    │ openHAB Core :: Bundles :: Configuration UPnP Discovery
220 │ Active │  80 │ 2.5.0.201902220309    │ openHAB Core :: Bundles :: UPnP Transport
221 │ Active │  80 │ 1.1.1.201605111122    │ Swagger Provider
222 │ Active │  80 │ 2.4.5                 │ Jackson-annotations
223 │ Active │  80 │ 2.4.5                 │ Jackson-core
224 │ Active │  80 │ 2.4.5                 │ jackson-databind
225 │ Active │  80 │ 2.4.5                 │ Jackson-dataformat-XML
226 │ Active │  80 │ 2.4.5                 │ Jackson-dataformat-YAML
227 │ Active │  80 │ 2.4.5                 │ Jackson-module-JAXB-annotations
228 │ Active │  80 │ 1.5.8                 │ swagger-annotations
229 │ Active │  80 │ 1.5.8                 │ swagger-core
230 │ Active │  80 │ 1.5.8                 │ swagger-jaxrs
231 │ Active │  80 │ 1.5.8                 │ swagger-models
232 │ Active │  80 │ 3.19.0.GA             │ Javassist
233 │ Active │  80 │ 3.2.1                 │ Apache Commons Lang
234 │ Active │  80 │ 2.5.0.201902241632    │ openHAB REST Documentation
235 │ Active │  80 │ 0.9.10.v20160429-1435 │ reflections (wrap)
236 │ Active │  80 │ 3.1.4                 │ Stax2 API
237 │ Active │  80 │ 1.5.8.v20160511-1038  │ swagger-jersey2-jaxrs (wrap)

@cweitkamp cweitkamp transferred this issue from openhab/openhab-addons Feb 25, 2019
@cweitkamp cweitkamp changed the title [deconz] Websocket connection could not be stopped properly Websocket connection could not be stopped properly Feb 25, 2019
@cweitkamp
Copy link
Contributor Author

A quick update - this currently happens in other cases too (on snapshot version 1607) - not only for deCONZ binding.

2019-06-05 11:31:11.200 [WARN ] [e.jetty.util.thread.QueuedThreadPool] - QueuedThreadPool[ESH-httpClient-common]@4744d7bb{STOPPING,10<=10<=40,i=0,q=4}[org.eclipse.jetty.util.thread.TryExecutor$$Lambda$169/2133582668@57dc9162] Couldn't stop Thread[ESH-httpClient-common-166,5,Configuration Admin Service]
2019-06-05 11:31:11.201 [WARN ] [e.jetty.util.thread.QueuedThreadPool] - QueuedThreadPool[ESH-httpClient-common]@4744d7bb{STOPPING,10<=10<=40,i=0,q=4}[org.eclipse.jetty.util.thread.TryExecutor$$Lambda$169/2133582668@57dc9162] Couldn't stop Thread[ESH-httpClient-common-165,5,Configuration Admin Service]

@cweitkamp
Copy link
Contributor Author

Nothing we can really do here - see eclipse-archived/smarthome#6636 (comment).

The only thing we maybe can do is to reduce the logging level in org.ops4j.pax.logging.cfg:

log4j2.logger.jettyQueuedThreadPool.name = org.eclipse.jetty.util.thread.QueuedThreadPool
log4j2.logger.jettyQueuedThreadPool.level = ERROR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants