Skip to content

Backport of Update lock.mdx (Node Health Check and TTL) into release/1.20.x #22262

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: release/1.20.x
Choose a base branch
from

Conversation

hc-github-team-consul-core
Copy link
Collaborator

@hc-github-team-consul-core hc-github-team-consul-core commented Apr 16, 2025

Backport

This PR is auto-generated from #22258 to be assessed for backporting due to the inclusion of the label backport/1.20.

The below text is copied from the body of the original PR.


Overview of commits

Title
Consul lock docs: Clarify node checks & TTL behavior, plus manual session workaround

Description

This PR updates the consul lock command documentation to explain how an ephemeral session is automatically created with node checks (e.g. serfHealth), which can cause the lock’s TTL to be effectively auto-renewed as long as the node is healthy. It also outlines a recommended workaround (manually creating and managing a custom session) for users who need strict TTL enforcement without node checks.

Testing & Reproduction Steps

  • No functional code changes – this is a documentation-only update.
  • Relevant sections:
    • A new note/section titled “Node Health Checks and TTL Behavior.”
    • Explains that the default session includes node checks, leading to indefinite lock behavior unless manually overridden.
  • Validation:
    1. Confirmed that the agent/session_endpoint.go sets NodeChecks to [serfHealth] by default.
    2. Verified that consul lock does not expose a built-in flag for removing node checks.
    3. Tested a scenario in which a user removes node checks by manually calling the session create API, verifying the lock expires after TTL if not renewed.

Links

  • GitHub Issue #5205 (related example of locks not releasing after session deletion)

PR Checklist

  • updated external-facing docs to clarify node health check behavior
  • test coverage not applicable (no code changes)
  • not a security concern

Overview of commits

Copy link
Collaborator

Choose a reason for hiding this comment

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

Auto approved Consul Bot automated PR

@github-actions github-actions bot added the type/docs Documentation needs to be created/updated/clarified label Apr 16, 2025
@natemollica-nm natemollica-nm enabled auto-merge (squash) April 21, 2025 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/docs Documentation needs to be created/updated/clarified
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants