FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat: add a maximum hold duration to expiring locks by jeswr · Pull Request #2221 · CommunitySolidServer/CommunitySolidServer · GitHub

feat: add a maximum hold duration to expiring locks - #2221

Open
jeswr wants to merge 3 commits into
CommunitySolidServer:versions/next-majorfrom
jeswr:feat/lock-max-hold-duration-next-major
Open

feat: add a maximum hold duration to expiring locks#2221
jeswr wants to merge 3 commits into
CommunitySolidServer:versions/next-majorfrom
jeswr:feat/lock-max-hold-duration-next-major

Conversation

jeswr commented Aug 22, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

📁 Related issues

Related to #2219.

This is the versions/next-major port of jeswr/CommunitySolidServer#87.

✍️ Description

Adds an optional absolute maximum hold duration to WrappedExpiringReadWriteLocker. The existing inactivity timeout can still be renewed, while the new deadline is never extended; reaching either deadline releases the wrapped lock and rejects the operation.

The new constructor argument defaults to 0, preserving the current uncapped behavior. An opt-in file-locker configuration caps total hold time at one hour, and its Components.js contexts have been updated for v8/versions/next-major.

Suggested label: semver.minor.

Review questions:

  • Is a separate opt-in file-locker configuration useful, or should this PR expose only the constructor option?
  • Is one hour a suitable cap for that opt-in configuration?

Validation:

  • npm run build
  • ESLint on the affected source and test files
  • WrappedExpiringReadWriteLocker.test.ts (9 tests)

npm run validate currently fails while parsing the generated AuxiliaryLinkMetadataWriter component metadata. The same failure was reproduced on a pristine origin/versions/next-major worktree, before this configuration is evaluated.

✅ PR check list

Before this pull request can be merged, a core maintainer will check whether

  • this PR is labeled with the correct semver label - this is a minor change, I do not have permission to apply labels
    • semver.minor: Backwards compatible feature additions.
  • the correct branch is targeted. Patch updates can target main, other changes should target the latest versions/* branch.
  • the RELEASE_NOTES.md document in case of relevant feature or config changes.
  • any relevant documentation was updated to reflect the changes in this PR.

Add an optional absolute deadline that activity renewals cannot extend, preventing indefinitely renewed read locks from starving writers. A zero value preserves unlimited existing behavior, while an opt-in file-locker configuration caps holds at one hour.
jeswr marked this pull request as ready for review August 22, 2026 14:13
Copilot AI lite review requested due to automatic review settings August 22, 2026 14:13
jeswr marked this pull request as draft August 22, 2026 14:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Pull request overview

Adds an optional maximum hold duration for expiring locks, preserving uncapped behavior by default.

Changes:

  • Adds maximum hold duration support.
  • Adds capped and uncapped behavior tests.
  • Adds an opt-in one-hour capped file-locker configuration.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Review findings
test/unit/util/locking/WrappedExpiringReadWriteLocker.test.ts Nit (3 votes): Add coverage verifying the underlying lock is released when the cap fires.
src/util/locking/WrappedExpiringReadWriteLocker.ts Moderate (3 votes): Prevent renewals and clear inactivity timers after the maximum deadline wins.
config/util/resource-locker/file-capped.json Nit (2 votes): Document the capped configuration in config/util/README.md.
Suppressed comments (1)

config/util/resource-locker/file-capped.json:23

  • This PR adds a public locking option and ships a new configuration, but RELEASE_NOTES.md is unchanged. The repository guidance requires release notes for relevant feature/configuration changes (and for minor releases); please document the new maximum-hold option and the opt-in file configuration before merging.
      "maxHoldDuration": 3600000

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

jeswr left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This is a configuration change so should be discussed in the release notes

jeswr commented Aug 22, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the review in a6a900b: added the release-note and resource-locker documentation, fixed timer cleanup and post-deadline renewals, and added coverage for underlying lock release.

jeswr commented Aug 22, 2026

Copy link
Copy Markdown
Contributor Author

Follow-up 6e6158d removes unreachable defensive branches identified by the coverage gate. The focused locker suite now has 100% statement, branch, function, and line coverage.

jeswr marked this pull request as ready for review August 22, 2026 15:17

jeswr commented Aug 22, 2026

Copy link
Copy Markdown
Contributor Author

I have reviewed this, it is ready for maintainer review

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL