jonasplaum opened a new issue, #6183:
URL: https://github.com/apache/couchdb/issues/6183

   ### Version
   
   3.5.1
   
   ### Describe the problem you're encountering
   
   We found that sometimes a Nouveau request fails with an internal server 
error. The following is the log line of our service that shows the response we 
receive from CouchDB:
   `500 Internal Server Error 
{"error":"stream_error","reason":"{goaway,no_error,'The connection is going 
away.'}"}`
   
   CouchDB logs this as:
   `[notice] 2026-10-28T14:03:41.945269Z [email protected] <0.170476304.4> 
e0e5bd2008 10.x.x.x.:5984 10.x.x.x manager POST 
/evidence-2026-10/_design/EVIDENCE_VIEW/_nouveau/AST_CHANNEL_IDS_UTC_C076 500 
ok 2`
   
   Without any exception in the log.
   
   ### Expected Behaviour
   
   All requests should work.
   
   ### Steps to Reproduce
   
   We analyzed the issue and found that this is most likely a race between 
Jetty closing a connection and CouchDB sending a request. We first looked into 
adding a retry for this just like the existing retry in `nouveau_api.erl`:
   `{error, no_connection_available, _Reason} when RemainingTries > 0`
   In my opinion this would be safe, because if we get `goaway` the receiving 
server (Jetty) has not processed the request. While analyzing logs of customer 
systems, we found similar errors:
   `500 Internal Server Error 
{"error":"stream_error","reason":"{stream_error,cancel,'Stream reset by 
server.'}"}`
   This is most likely the same race, but I'm not sure if this case would be 
safe to retry.
   
   I think the best solution would be to send Keep-Alive request so that the 
connections don't get closed and the race cant be triggered.
   
   ### Your Environment
   
   Debian 12 and Debian 13 with CouchDB 3.5.1 and 3.5.2. Probably also with 
CouchDB 3.5.3, but I haven't checked all customer systems. 
   
   ### Additional Context
   
   _No response_


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