Skip to content

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

Merged
nitin-sachdev-29 merged 2 commits intorelease/1.21.xfrom
backport/docs-consul-lock-update/privately-simple-phoenix
Apr 17, 2025
Merged

Backport of Update lock.mdx (Node Health Check and TTL) into release/1.21.x#22263
nitin-sachdev-29 merged 2 commits intorelease/1.21.xfrom
backport/docs-consul-lock-update/privately-simple-phoenix

Conversation

@hc-github-team-consul-core
Copy link
Copy Markdown
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.21.

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
Copy Markdown
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
Copy link
Copy Markdown
Contributor

@nitin-sachdev-29 nitin-sachdev-29 left a comment

Choose a reason for hiding this comment

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

LGTM

@nitin-sachdev-29 nitin-sachdev-29 merged commit d7dfd45 into release/1.21.x Apr 17, 2025
58 of 60 checks passed
@nitin-sachdev-29 nitin-sachdev-29 deleted the backport/docs-consul-lock-update/privately-simple-phoenix branch April 17, 2025 06:16
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.

4 participants