Files
openhab-core/bundles/org.openhab.core.ui.icon
Florian HotzeandGitHub aff119cd19 IconServlet: Remove error & warn logging when client disconnected while sending response (#5257)
When a client disconnected while receiving the icon byte stream response,
an error and a warning were logged, making users worried:

```
2022-08-15 20:09:31.387 [ERROR] [ab.core.ui.icon.internal.IconServlet] - Failed sending the icon byte stream as a response: null
2022-08-15 20:09:31.390 [WARN ] [org.eclipse.jetty.server.HttpChannel] - /icon/autarky
java.lang.IllegalStateException: ABORTED
	at org.eclipse.jetty.server.HttpChannelState.sendError(HttpChannelState.java:915) ~[?:?]
    ...
```

IMO, there is no need to log at ERROR or WARN level in such cases,
so I decided to reduce to DEBUG logging.

The following script can be used to reproduce the above case:

```python
import socket
import struct

host = 'localhost'
port = 8080
path = '/icon/BatteryLevel?format=svg&anyFormat=true&state=94+%25&iconset=classic'
request = f"GET {path} HTTP/1.1\r\nHost: {host}\r\nConnection: keep-alive\r\n\r\n"

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((host, port))

# Send the request
s.sendall(request.encode())

# FORCE an immediate hard reset (RST)
# This ensures the server sees a connection failure while it's inside doGet
s.setsockopt(socket.SOL_SOCKET, socket.SO_LINGER, struct.pack('ii', 1, 0))
s.close()
```

Signed-off-by: Florian Hotze <dev@florianhotze.com>
2026-01-17 19:45:21 +01:00
..
2024-12-24 07:02:47 +01:00
2019-02-15 10:46:18 +01:00
2025-12-22 22:01:01 +01:00