nickva opened a new pull request, #6217:
URL: https://github.com/apache/couchdb/pull/6217

   An empty chunk in mochiweb is how we tell is the chunked response ended. So 
if we still have to send one final newline ,like we do in the case of 
eventsource to end the stream, we ended the response too early.
   
   This was not noticeable with curl, but it was noticeable in the logs or if 
there is a subsequent request on the same connection.
   
   We caught this in the server-side gzip compression PR during the review 
since there the gzip compressor threw an error in the log:
   
   ```
   curl -XPUT 
http://adm:[email protected]:15984/_node/_local/_config/chttpd/response_compression
 -d '"true"'
   curl -XPUT http://adm:[email protected]:15984/db
   curl --compressed 
'http://adm:[email protected]:15984/db/_changes?feed=eventsource&timeout=1000'
   ```
   [1] https://github.com/apache/couchdb/pull/6122#issuecomment-6783113475
   
   log
   ```
   [error] 2026-11-11T00:21:04.711596Z [email protected] <0.12581.0> f59f4733a4 
req_err(2997429273) unknown_error : not_initialized
       
[<<"zlib:enqueue_nif/2">>,<<"zlib:enqueue_input_1/2">>,<<"zlib:deflate/3">>,<<"mochiweb_response:write_chunk/2
 L129">>,<<"couch_httpd:send_chunk/2">>,<<"couch_httpd:end_json_response/1 
L958">>,<<"fabric
   _view_changes:go/5 L68">>,<<"chttpd_db:handle_changes_req1/2 L173">>]
   ```
   
   The bug however, is not gzip related per-se. It was a latent bug lingering 
in the main code base for a while, that why we're fixing it separately here.
   


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

Reply via email to