| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
…g fails It dropped the record whose send failed and reconnected only on the next record. Now it reopens the socket and sends the record again. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The test left the server-side connections unclosed, which regrtest reported as an altered environment (ResourceWarning: unclosed socket). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
| # retry time yet, or because we have reached the retry time | ||
| # and retried, but are still unable to connect. | ||
| if self.sock is None: | ||
| return |
There was a problem hiding this comment.
How about a break here? I prefer not to do early returns - e.g. if we were ever to add something after the for statement, we wouldn't need to revisit this line.
Sorry, something went wrong.
| try: | ||
| self.sock.sendall(s) | ||
| except OSError: #pragma: no cover | ||
| return |
There was a problem hiding this comment.
As comment above.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
SocketHandler.send() dropped the record whose sending failed and reconnected only on the next record, so after the connection was closed (for example after an idle timeout) it lost more records than necessary.
It now reopens the socket and sends the record again, like SysLogHandler.emit() has done for the Unix socket since 2.5.
This does not make SocketHandler lossless over TCP: the first record sent after the connection is closed still succeeds locally and is lost when the reset arrives, which cannot be detected. But it stops dropping the following record, whose send actually fails.
🤖 Generated with Claude Code