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 2020/02/28 16:39:58 UTC

[GitHub] [couchdb] ricellis opened a new issue #2613: 500 instead of 412 response in DB creation race

ricellis opened a new issue #2613: 500 instead of 412 response in DB creation race
URL: https://github.com/apache/couchdb/issues/2613
 
 
   [NOTE]: # ( ^^ Provide a general summary of the issue in the title above. ^^ )
   
   ## Description
   
   [NOTE]: # ( Describe the problem you're encountering. )
   [TIP]:  # ( Do NOT give us access or passwords to your actual CouchDB! )
   
   In my scenario multiple clients are trying to create the same database (actually `_replicator`, but it is true for any DB), the code gracefully handles the expected `412` if the database exists, but sometimes a `500 {"error":"error", "reason":"conflict"}` is received instead.
   
   ## Steps to Reproduce
   
   [NOTE]: # ( Include commands to reproduce, if possible. curl is preferred. )
   
   Run two threads in parallel creating the same database name. It can take quite a few attempts to provoke it - I see this problem on around ~6% of attempts.
   
   ## Expected Behaviour
   
   [NOTE]: # ( Tell us what you expected to happen. )
   
   Expected to receive a `412` on the losing thread.
   
   ## Your Environment
   
   [TIP]:  # ( Include as many relevant details about your environment as possible. )
   [TIP]:  # ( You can paste the output of curl http://YOUR-COUCHDB:5984/ here. )
   
   `apache/couchdb:3` docker, but I have also reproduced on `2.3.1`
   
   * CouchDB version used: 3.0.0 & 2.3.1
   * Browser name and version:
   * Operating system and version: docker (on macOS)
   
   ## Additional Context
   
   [TIP]:  # ( Add any other context about the problem 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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [couchdb] nickva commented on issue #2613: 500 instead of 412 response in DB creation race

Posted by GitBox <gi...@apache.org>.
nickva commented on issue #2613: 500 instead of 412 response in DB creation race
URL: https://github.com/apache/couchdb/issues/2613#issuecomment-592663682
 
 
   @ricellis 
   
   Thank you for your bug report.
   
   This is a valid bug. It happens in this function:
   
   https://github.com/apache/couchdb/blob/master/src/fabric/src/fabric_db_create.erl#L37
   
   
   Two concurrent requests can both check that the db exists, that can return`false` for both so they then proceed to create the shard doc. One can succeed and the other will get a conflict.

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


With regards,
Apache Git Services

[GitHub] [couchdb] wohali closed issue #2613: 500 instead of 412 response in DB creation race

Posted by GitBox <gi...@apache.org>.
wohali closed issue #2613: 500 instead of 412 response in DB creation race
URL: https://github.com/apache/couchdb/issues/2613
 
 
   

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


With regards,
Apache Git Services