Yicong-Huang opened a new issue, #4726:
URL: https://github.com/apache/texera/issues/4726
### What happened?
`amber/src/main/python/core/runnables/heartbeat.py::Heartbeat._check_heartbeat`
wraps both `socket.create_connection` and the subsequent `temp_socket.close()`
in a single try/except. If `close()` raises after a successful connect, the
method logs `"Server is down"` and returns `False` even though the JVM is
reachable. The double-check in `run()` masks transient cases but the
misclassification can still trigger unwarranted shutdowns.
### How to reproduce?
```python
from unittest.mock import patch, MagicMock
from threading import Event
from core.runnables.heartbeat import Heartbeat
hb = Heartbeat("localhost", 12345, 0.1, Event())
sock = MagicMock()
sock.close.side_effect = OSError("close failed")
with patch("core.runnables.heartbeat.socket.create_connection",
return_value=sock):
print(hb._check_heartbeat()) # False, log says "Server is down"
```
### Version
1.1.0-incubating (Pre-release/Master)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]