nickva commented on PR #4729:
URL: https://github.com/apache/couchdb/pull/4729#issuecomment-1690154789
> I am less keen to see the raw packet inspection stuff in couchdb in
general, unless we can be confident that it causes no harm on any platform we
haven't handled.
Yeah, it would definitely be nicer if `inet:monitor/1` or `inet:info/1`
worked here. However we have a limited set of supported platforms compared to
Erlang/OTP itself, so we could test them in CI. On the ones I tried so far
(linux: ubuntu on x86_64, ppc64le, z-linux, macos, windows) when it doesn't
support the raw option it returns `{ok, []}` which we interpret as the default
`socket not closed`. It does look ugly but it seems fairly safe as it doesn't
alter the packet stream just copies a single byte from the stats, and we can
always fallback to the old behavior for unsupported/unexpected platforms.
> As for heartbeats in the `_find` response, this obviously changes the
response in a way that no client is currently expected. The idea that a blank
line (or whitespace in general) will be silently handled is reasonable but
requires a lot of testing to be confident.
One thing this approach has for it is it has some precedent in the _changes
feed. I think it's fairly likely that a client library would use the same
streaming json parser code for both endpoints. But of course there could be
cases of users rolling their own and only ever parsing _find and maybe
_all_docs and never _changes feeds with heartbeats...
--
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]