OH freeze when http item is offline

OH install on debain 9. Working good, but ia have any problem.
I have any item? created as HttpBinding. When all items (devices) is online OH works good, but when one item is offline OH freeze? and rules works with delay. It delay doing works OH impossible, because button on HabPanel click, but action takes after any time (10-20 seconds).
In console error:
21:56:38.736 [ERROR] [org.openhab.io.net.http.HttpUtil ] - Fatal transport error: java.net.NoRouteToHostException: Нет маршрута до узла (Host unreachable)
21:56:38.738 [ERROR] [hab.binding.http.internal.HttpBinding] - No response received from ‘http://192.168.100.101/index.html
and this will be normal, because device is offline.
Question: How explain to OH what offine device not no need to interrogate?

Do you have Thread::sleep commands in your Rules or other commands that take a long time to complete? There are only 5 rule threads available so if you have five long running Rules active at a given time, no new Rules can run until one of those exits. That is the usual cause of the behavior you are seeing.

To deal with the error log you can’t use the HTTP binding. The best you can do is something like the following:

  • Create an online/offline Switch Item using the Network binding that will ON when the device is online and OFF when the device is offline.

  • Create a Time cron triggered rule and use sendHttpGetRequest to try and get the contents at the URL. Only check the online/offline Switch Item first and only send the request when it is online.

  • If you successfully pulled the contents of the URL, you can call the transforms you may be using with transform("Type", "File", results) where “Type” is the transform type (e.g. JS), “File” is the config file or transform config (e.g. “data.js”, or “$.root.child.data” for JSONPATH, etc) and “results” is what you got back from sendHttpGetRequest.

Rules, what i use is simple and newer use Thread::sleep. I execute one action over trigger. I think than OH scan all items and if item is offline OH wait time to response and after execute scaning next items so again and again. These scans increase the delay.

As I understood in your idea, I need create string items, create rule and assign value these items over rule after receive suces response from online device?

I think you have it but if you have problems come back and post your items and code.

You were right. Instead of HttpBinding, I began using sendHTTPGetRequest and it all worked correctly. Thank you.