VSCode crashes Openhab

From openHAB 2.5.0~S1759-1 till 2.5.0~S1762-1 I’m not able to use VSCode anymore, because a short time after opening VSCode openHAB don’t work properly anymore.
I get errors and warnings like this (strange enough it seems to kill the http client):

2019-11-23 11:00:12.168 [ERROR] [.smarthome.model.script.actions.HTTP] - Fatal transport error: java.util.concurrent.TimeoutException: Total timeout 5000 ms elapsed
2019-11-23 11:00:32.637 [WARN ] [l.handler.ICloudAccountBridgeHandler] - Unable to refresh device data
java.io.IOException: java.util.concurrent.TimeoutException: Total timeout 10000 ms elapsed
	at org.eclipse.smarthome.io.net.http.HttpUtil.executeUrlAndGetReponse(HttpUtil.java:259) ~[?:?]
	at org.eclipse.smarthome.io.net.http.HttpUtil.executeUrl(HttpUtil.java:156) ~[?:?]
	at org.eclipse.smarthome.io.net.http.HttpUtil.executeUrl(HttpUtil.java:131) ~[?:?]
	at org.eclipse.smarthome.io.net.http.HttpRequestBuilder.getContentAsString(HttpRequestBuilder.java:135) ~[?:?]
	at org.openhab.binding.icloud.internal.ICloudConnection.callApi(ICloudConnection.java:88) ~[?:?]
	at org.openhab.binding.icloud.internal.ICloudConnection.requestDeviceStatusJSON(ICloudConnection.java:69) ~[?:?]
	at org.openhab.binding.icloud.internal.handler.ICloudAccountBridgeHandler.lambda$0(ICloudAccountBridgeHandler.java:88) ~[?:?]
	at org.eclipse.smarthome.core.cache.ExpiringCache.refreshValue(ExpiringCache.java:101) ~[?:?]
	at org.eclipse.smarthome.core.cache.ExpiringCache.getValue(ExpiringCache.java:72) ~[?:?]
	at org.openhab.binding.icloud.internal.handler.ICloudAccountBridgeHandler.refreshData(ICloudAccountBridgeHandler.java:145) ~[?:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_222]
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:1.8.0_222]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_222]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:1.8.0_222]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_222]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_222]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_222]
Caused by: java.util.concurrent.TimeoutException: Total timeout 10000 ms elapsed
	at org.eclipse.jetty.client.TimeoutCompleteListener.onTimeoutExpired(TimeoutCompleteListener.java:51) ~[?:?]
	at org.eclipse.jetty.io.CyclicTimeout$Wakeup.run(CyclicTimeout.java:282) ~[?:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_222]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_222]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) ~[?:1.8.0_222]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) ~[?:1.8.0_222]
	... 3 more
2019-11-23 11:02:38.459 [WARN ] [me.core.internal.events.EventHandler] - Dispatching event to subscriber 'org.eclipse.smarthome.core.internal.items.ItemUpdater@2ec15' takes more than 5000ms.
2019-11-23 11:03:56.425 [WARN ] [me.core.internal.events.EventHandler] - Dispatching event to subscriber 'org.eclipse.smarthome.io.monitor.internal.EventLogger@1660aae' takes more than 5000ms.

When closing VSCode OpenHAB doesn’t recover. The warnings related to the ItemUpdater are still increasing and items won’t get updated.

I cleared the cache already and upgrades a few times to the next available snapshot.

Hm, the warnings and errors are strange.
I can’t see how they could be related to Vscode for now and what Vscode is causing here.

What are your vscode and openHAB extension version?

Do you have remote LSP enabled in your extension config?
Is rest API active?

What system is openHAB running on?

VSCode:

Version: 1.40.1
Commit: 8795a9889db74563ddd43eb0a897a2384129a619
Datum: 2019-11-13T16:47:44.719Z
Electron: 6.1.2
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
Betriebssystem: Darwin x64 18.7.0

openHAB extension:

0.6.0

Extension config:

settings.json:

{
    "git.ignoreMissingGitWarning": true,
    "telemetry.enableTelemetry": false,
    "openhab.host": "192.168.188.55",
    "openhab.port": 8080
}

System:

Release = Raspbian GNU/Linux 9 (stretch)
Kernel = Linux 4.19.58-v7+
Platform = Raspberry Pi 3 Model B Rev 1.2

To produce the errors and warnings it is enough to click in VSCode the openHAB extension icon on the left side, that lists the items and things.

That’s a new one:

2019-11-23 13:52:01.816 [WARN ] [com.zaxxer.hikari.pool.HikariPool   ] - 48s95ms378μs550ns - Thread starvation or clock leap detected (housekeeper delta=yank-default)

Edit: this also:

2019-11-23 13:56:35.885 [ERROR] [java.impl.http.impl.AccessoryHandler] - Exception caught in web handler
java.lang.NullPointerException: null
	at io.github.hapjava.impl.http.impl.AccessoryHandler.channelActive(AccessoryHandler.java:36) ~[?:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(AbstractChannelHandlerContext.java:210) [bundleFile:4.1.34.Final]
	at io.netty.channel.AbstractChannelHandlerContext.access$200(AbstractChannelHandlerContext.java:38) [bundleFile:4.1.34.Final]
	at io.netty.channel.AbstractChannelHandlerContext$3.run(AbstractChannelHandlerContext.java:201) [bundleFile:4.1.34.Final]
	at io.netty.util.concurrent.DefaultEventExecutor.run(DefaultEventExecutor.java:66) [bundleFile:4.1.34.Final]
	at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:905) [bundleFile:4.1.34.Final]
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [bundleFile:4.1.34.Final]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_222]
2019-11-23 13:57:33.614 [WARN ] [th.manager.impl.BluetoothManagerImpl] - Removing stale device: tinyb:/34:C9:F0:88:B0:DE/FE:C0:A1:38:31:B6 : -93 
2019-11-23 13:56:35.885 [WARN ] [com.zaxxer.hikari.pool.HikariPool   ] - 2m38s101ms173μs545ns - Thread starvation or clock leap detected (housekeeper delta=yank-default).
2019-11-23 13:56:35.885 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - ipCamera restarting.
2019-11-23 13:56:35.885 [WARN ] [l.handler.ICloudAccountBridgeHandler] - Unable to refresh device data
java.io.IOException: java.util.concurrent.TimeoutException: Total timeout 10000 ms elapsed
	at org.eclipse.smarthome.io.net.http.HttpUtil.executeUrlAndGetReponse(HttpUtil.java:259) ~[?:?]
	at org.eclipse.smarthome.io.net.http.HttpUtil.executeUrl(HttpUtil.java:156) ~[?:?]
	at org.eclipse.smarthome.io.net.http.HttpUtil.executeUrl(HttpUtil.java:131) ~[?:?]
	at org.eclipse.smarthome.io.net.http.HttpRequestBuilder.getContentAsString(HttpRequestBuilder.java:135) ~[?:?]
	at org.openhab.binding.icloud.internal.ICloudConnection.callApi(ICloudConnection.java:88) ~[?:?]
	at org.openhab.binding.icloud.internal.ICloudConnection.requestDeviceStatusJSON(ICloudConnection.java:69) ~[?:?]
	at org.openhab.binding.icloud.internal.handler.ICloudAccountBridgeHandler.lambda$0(ICloudAccountBridgeHandler.java:88) ~[?:?]
	at org.eclipse.smarthome.core.cache.ExpiringCache.refreshValue(ExpiringCache.java:101) ~[?:?]
	at org.eclipse.smarthome.core.cache.ExpiringCache.getValue(ExpiringCache.java:72) ~[?:?]
	at org.openhab.binding.icloud.internal.handler.ICloudAccountBridgeHandler.refreshData(ICloudAccountBridgeHandler.java:145) ~[?:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_222]
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:1.8.0_222]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_222]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:1.8.0_222]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_222]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_222]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_222]
Caused by: java.util.concurrent.TimeoutException: Total timeout 10000 ms elapsed
	at org.eclipse.jetty.client.TimeoutCompleteListener.onTimeoutExpired(TimeoutCompleteListener.java:51) ~[?:?]
	at org.eclipse.jetty.io.CyclicTimeout$Wakeup.run(CyclicTimeout.java:282) ~[?:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_222]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_222]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) ~[?:1.8.0_222]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) ~[?:1.8.0_222]
	... 3 more
2019-11-23 13:57:33.622 [WARN ] [me.core.internal.events.EventHandler] - Dispatching event to subscriber 'org.eclipse.smarthome.core.internal.items.ItemUpdater@8a4d75' takes more than 5000ms.
2019-11-23 13:59:26.636 [WARN ] [th.manager.impl.BluetoothManagerImpl] - Removing stale device: tinyb:/34:C9:F0:88:B0:DE/4E:45:D5:61:F8:C3 : -98 
2019-11-23 13:59:07.646 [ERROR] [java.impl.http.impl.AccessoryHandler] - Exception caught in web handler
java.lang.NullPointerException: null
	at io.github.hapjava.impl.http.impl.AccessoryHandler.channelActive(AccessoryHandler.java:36) ~[?:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(AbstractChannelHandlerContext.java:210) [bundleFile:4.1.34.Final]
	at io.netty.channel.AbstractChannelHandlerContext.access$200(AbstractChannelHandlerContext.java:38) [bundleFile:4.1.34.Final]
	at io.netty.channel.AbstractChannelHandlerContext$3.run(AbstractChannelHandlerContext.java:201) [bundleFile:4.1.34.Final]
	at io.netty.util.concurrent.DefaultEventExecutor.run(DefaultEventExecutor.java:66) [bundleFile:4.1.34.Final]
	at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:905) [bundleFile:4.1.34.Final]
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [bundleFile:4.1.34.Final]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_222]

After the last error openHAB is not responding anymore.

So other messages who also include the items updater. At least that’s what I see from mobile now.

When you click the openHAB icon, the extension tries to load all items and things over rest api.
Those are some ressource intensive calls, but I have never seen a system giving up on this. :man_shrugging:
There wasn’t any change in that extension part in the last version.
We are just presenting the icon to click on now permanently.

Let’s wait for some more feedback.

Ok, thanks for your explanation.
I can call

curl -X GET --header "Accept: application/json" "http://192.168.188.55:8080/rest/items?recursive=false"

and

curl -X GET --header "Accept: application/json" "http://192.168.188.55:8080/rest/things"

without any problems.
So it looks like, that the rest api call itself isn’t causing the problem.

I had the same problem for some time. My problem was, that i use a Intel Nuc with 16GB ram but using standard settings of xms and xmx. After changing to a higher level, it runs again without problems.
Greetings,
Markus

Can you set recursive to true for testing?

curl -X GET --header "Accept: application/json" "http://192.168.188.55:8080/rest/items?recursive=true"

is causing no problem.

Maybe you could try the approach from markus.

Those calls are the mosz ressource intensive we are doing with Vscode extension.

Another thing you could do is disable remote LSP for testing.