Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Closing DB leaves the database locked #78

Closed
shuse2 opened this issue Dec 3, 2022 · 0 comments · Fixed by #79
Closed

Closing DB leaves the database locked #78

shuse2 opened this issue Dec 3, 2022 · 0 comments · Fixed by #79
Assignees
Milestone

Comments

@shuse2
Copy link
Collaborator

shuse2 commented Dec 3, 2022

Expected behavior

Closing DB should be completely close the DB without leaving the trace. (lock file or open handles)

Actual behavior

After closing the DB, it leaves the LOCK file and it cannot re-opened

Steps to reproduce

  1. create DB
  2. close DB
  3. check the folder

Which version(s) does this affect? (Environment, OS, etc...)

0.3.0-debug.20-94522fbd51ec040e1040cdccd1b0572d805a2825

last working version checked was 52ffbeac2c1b0b188e8df995a1dc6a1634426a27

@hrmhatef hrmhatef self-assigned this Dec 3, 2022
@Madhulearn Madhulearn modified the milestones: Sprint 12, Sprint 13 Dec 6, 2022
@shuse2 shuse2 closed this as completed in #79 Dec 6, 2022
shuse2 added a commit that referenced this issue Dec 6, 2022
### What was the problem?

This PR resolves #78

### How was it solved?

- Refactor the `DB` to stores an `option` of DB and change it to `None`
in `close` function.

### How was it tested?

- Add a new unit test to check the new implementation.
- All tests passed.
shuse2 added a commit to LiskArchive/lisk-sdk that referenced this issue Dec 10, 2022
### What was the problem?

This PR resolves #7783 

### How was it solved?

- Revert generator enable/disable command to have `--use-status-value`
  - Move height/max-height-generated/max-height-prevoted as flag
- Revert temporally lisk-db version to the previous version because it
leaves locks value LiskArchive/lisk-db#78
- Fix to pass `keypairs` from `generator` to `endpoint`
- Remove keypair when setting new key

### How was it tested?

1. clean ` rm -rf ~/.lisk/pos-mainchain`
2. encrypt keys `./bin/run keys:encrypt -f
./config/default/dev-validators.json`
3. import new keys `./bin/run keys:import -f
config/default/dev-validators.json`
4. enable block generation `./bin/run generator:enable
lsk2xxvfxaqpm42wr9reokucegh3quypqg9w9aqfo --height=0
--max-height-prevoted=0 --max-height-generated=0`
5. check block is generated (wait for 1 round)
6. check status `./bin/run generator:status --pretty`
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants