HarperFast / HarperFast/harper

Harper fails to restart: 'Thread has been restarted undefined times' after LMDB transaction errors

Open
#815 0 comments 0 reactions 0 assignees View on GitHub
area:storage bug from-jira
Dominant language
JavaScript
Stars
89
Forks
10
Avg merge
2d 6h
Merged PRs (30d)
200

Description

## Problem

After a restart triggered by tests, Harper sometimes fails to come back up with:

```
uncaughtException Error: Invalid argument: No transaction to renew opening database
Thread has been restarted undefined times and will not be restarted
```

Also seen: `MDB_BAD_RSLOT: Invalid reuse of reader locktable slot: The reader lock pid 0, txn -1, doesn't match env pid 1`

## Details

- Flaky — not every test run triggers it
- Observed with both `threads.count=2` (default) and `threads.count=3`
- Happens during Docker CI test runs when Postman collection restarts Harper mid-suite
- The "undefined times" suggests the restart count tracking has a bug (NaN/undefined instead of a number)

🤖 Filed by Claude on behalf of Kris.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.