nickva commented on PR #4729:
URL: https://github.com/apache/couchdb/pull/4729#issuecomment-1688590578
I managed to find a way to seemingly detect the connection state change
after the local client (curl) disconnects by querying the equivalent of
`getsockopt(fd(), IPPROTO_TCP,
nickva commented on PR #4729:
URL: https://github.com/apache/couchdb/pull/4729#issuecomment-1686663150
> it ought to kill the process/port for the socket, which I think will kill
the mochiweb process, but subject to testing
It doesn't hurt to try I don't see how that could plausibly
nickva commented on PR #4729:
URL: https://github.com/apache/couchdb/pull/4729#issuecomment-1686633468
On localhost `keepalive` won't behave any differently for disconnects, as
network handling is just a direct callback into the other peer's socket code at
the kernel level. In other words
nickva commented on PR #4729:
URL: https://github.com/apache/couchdb/pull/4729#issuecomment-1686478247
In principle at least the experimental `socket` module does allow `peek`-ing
with `recv` since OTP 24.0: https://www.erlang.org/doc/man/socket#type-msg_flag
>
```
msg_flag()
nickva commented on PR #4729:
URL: https://github.com/apache/couchdb/pull/4729#issuecomment-1684533075
> I confirmed directly and via haproxy that a client that disconnects (curl
and CTRL-C in the first case and simply doing something that hits haproxy's
server timeout like