Skip to content

fix: Always release lock when patching - #375

Merged
jvherweg merged 1 commit into
masterfrom
fix/patch-lock
Dec 2, 2020
Merged

jvherweg merged 1 commit into
masterfrom
fix/patch-lock

Conversation

@jvherweg

@jvherweg jvherweg commented Dec 1, 2020

Copy link
Copy Markdown
Member

Closes #367

@jvherweg jvherweg added the 🐛 bug Something isn't working label Dec 1, 2020
await this.applyPatch(identifier, deletes, inserts);
} finally {
await lock.release();
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That works indeed.
I wonder whether, for the future read/write interface, we want a withReadLock(identifier, fn) and withWriteLock(identifier, fn) structure to enforce this.

Any acquire without try/finally is essentially a mistake.

@jvherweg
jvherweg merged commit 3362eee into master Dec 2, 2020
@jvherweg
jvherweg deleted the fix/patch-lock branch December 2, 2020 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Default server leaves dangling locks on PATCH

2 participants