apache / apache/couchdb-nano

Deleting records frequently hangs for one minute or crashes

Open
#329 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
689
Forks
167
Avg merge
1h
Merged PRs (30d)
1

Description

## Expected Behavior
In my server I delete a single record from the db taking around 100 milliseconds. The deletion is done this way:
```
const sts = await databaseHandler.bulk({docs: [
{
_id: 'CRgLVMx5ELyYa8bl9sDad+++',
_rev: '73-12c2ea0e5981bf59e84db86ab9660265',
_deleted: true
}
]});
```
This works and takes 90-250 milliseconds, sometimes 2 seconds. The returning status is:
```
[
{
ok: true,
id: 'CRgLVMx5ELyYa8bl9sDad+++',
rev: '74-50b80ed261f55ea4f08999ec94c2ec3b'
}
]
```

## Current Behavior
Frequently the bulk call will take around 60 seconds and returns:
```
[
{
id: 'CRgLVMx5ELyYa8bl9sDad+++',
error: 'unknown_error',
reason: 'undefined'
}
]
```
or sometimes CouchDB returns status 500
```
Error: couch returned 500
at responseHandler (D:\Projects\VUEIdeaIgniterEnvironment\server\node_modules\nano\lib\nano.js:206:20)
at D:\Projects\VUEIdeaIgniterEnvironment\server\node_modules\nano\lib\nano.js:456:13
at processTicksAndRejections (node:internal/process/task_queues:95:5)
```
Really I don't know where to look to understand what happens
## Possible Solution
Well, for my side I could not wait for the deletion and returning immediately, but seems a dirty workaround. At least having a way for understanding what happens.

## Steps to Reproduce (for bugs)

1. See above

## Context

## Your Environment

* Version used: 10.1.2
* CouchDB: 3.3.1
* Browser Name and version: Chrome 112.0.5615.50 (Official Build) (64-bit)
* Operating System and version (desktop or mobile): Desktop Windows 11 64 bits
* Link to your project:

Contributor guide

Open the contributing guide

Research direction

Start with the bulk call in the report and the responseHandler at node_modules/nano/lib/nano.js:206, then inspect the request path around line 456. Reproduce the one-minute delay or 500 response using Nano 10.1.2 with CouchDB 3.3.1 on the stated environment. Done means the cause is identified and the failure reports a reliable result or is corrected.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
api, backend, database
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.