You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2021/04/27 16:58:14 UTC

[GitHub] [couchdb] iilyak commented on pull request #3530: Improve retry handling in _all_dbs, _dbs_info and _deleted_dbs

iilyak commented on pull request #3530:
URL: https://github.com/apache/couchdb/pull/3530#issuecomment-827761831


   I could be wrong, however after reading the code I came to conclusion that in case of a re-try we would be calling `UserCallback({row, Row}, Acc)` multiple times for the same row. This means that the response would have duplicates. Because we don't do anything with rows other than calling [`{ok, Resp1} = chttpd:send_delayed_chunk(Resp0, [Prepend, ?JSON_ENCODE(DbName)]),`](https://github.com/apache/couchdb/blob/main/src/chttpd/src/chttpd_misc.erl#L142
   
   I agree that this PR should fix multiple '[' characters on the fist line. However we still have changed/broken semantics of `_all_dbs` endpoint.
   
   Having in mind recent discussions about introducing limits on each response. It could be a good time to get away from streaming API and instead de-duplicate rows in memory before sending the result to client.
   
   This would fix the long due problem when client receives invalid JSON when erlang process dies while streaming.
   


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org