mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
[yamahareceiver] Fix read stall blocking OH thing handler thread pool (#17769)
Since no read timeout was set, reads blocked indefinitely, which in case of unreachable receiver led to blocking the OH thing handler thread pool, since multiple requests are launched into the thread pool simultaneously. Fixes #17768 Signed-off-by: Danny Baumann <dannybaumann@web.de>
This commit is contained in:
parent
8b2bbfe90c
commit
304f37d470
@ -47,6 +47,7 @@ public class XMLConnection extends AbstractConnection {
|
||||
private static final String HEADER_CHARSET_PART = "charset=";
|
||||
|
||||
private static final int CONNECTION_TIMEOUT_MS = 5000;
|
||||
private static final int READ_TIMEOUT_MS = 3000;
|
||||
|
||||
public XMLConnection(String host) {
|
||||
super(host);
|
||||
@ -77,6 +78,7 @@ public class XMLConnection extends AbstractConnection {
|
||||
|
||||
// Set a timeout in case the device is not reachable (went offline)
|
||||
connection.setConnectTimeout(CONNECTION_TIMEOUT_MS);
|
||||
connection.setReadTimeout(READ_TIMEOUT_MS);
|
||||
|
||||
connection.setUseCaches(false);
|
||||
connection.setDoInput(true);
|
||||
|
Loading…
Reference in New Issue
Block a user