Skip to content

docs: explain /tmp fallback in wait_readyz.sh - #326

Merged
smaramwbc merged 2 commits into
smaramwbc:mainfrom
Vignesh-P-C:fix/wait-readyz-tmp-comment-297
Aug 5, 2026
Merged

docs: explain /tmp fallback in wait_readyz.sh#326
smaramwbc merged 2 commits into
smaramwbc:mainfrom
Vignesh-P-C:fix/wait-readyz-tmp-comment-297

Conversation

@Vignesh-P-C

@Vignesh-P-C Vignesh-P-C commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Closes #297

Description

scripts/wait_readyz.sh writes cold-start timing data to ${STATEWAVE_COLD_TIMING_FILE:-/tmp/statewave_cold_ready_seconds} with no comment explaining the fallback path. This PR adds a short explanatory comment above that line so a contributor running the script standalone (e.g. on a non-POSIX system) understands why /tmp is used by default and knows to override it via STATEWAVE_COLD_TIMING_FILE. No behavior or logic changes — comment only.

Related Issue

Closes #297

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to change)
  • 📚 Documentation update
  • 🔧 Maintenance (refactoring, dependencies, CI, etc.)
  • 🧪 Test improvement

Changes Made

  • Added a two-line comment above the printf on line 19 of scripts/wait_readyz.sh, explaining the /tmp default and the STATEWAVE_COLD_TIMING_FILE override
  • No functional or logic changes

Testing

  • Unit tests pass locally
  • Integration tests pass locally
  • Manual testing completed
  • New tests added for new functionality

Test Commands Run

bash scripts/wait_readyz.sh http://localhost:8100

Checklist

  • My code follows the project's coding standards
  • I have performed a self-review of my code
  • I have commented my code where necessary
  • I have updated documentation as needed
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix/feature works
  • All existing tests pass
  • I have checked for breaking changes

Screenshots / Recordings

Additional Notes

No behavior change — verified by running the script manually against a live /readyz endpoint (see command above), which returned readyz: status=ready in 1s as expected.

Vignesh-P-C and others added 2 commits August 5, 2026 22:37
The script requires bash (shebang, set -euo pipefail, $SECONDS, (( )), [[ ]]),
so the shell dialect isn't what motivates overriding the path — the filesystem
is. Point the comment at that instead.

Also restore the newline at end of file, which was dropped in the previous
commit and would otherwise mark every future diff of this file.
@smaramwbc

smaramwbc commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Thanks for this — the fallback path genuinely deserved a comment, and you're right that it was surprising without one.

I've pushed two small tweaks to your branch (you had maintainer edits enabled) rather than sending you round again, since the second one is our fault rather than yours:

1. Reworded the comment. This is on our issue text, not on you — #297 described the problem as "a non-POSIX system", so following it was the right call. It's just not quite what bites people here: the script already requires bash (#!/usr/bin/env bash, set -euo pipefail, $SECONDS, (( )), [[ ]]), so it can't run under a POSIX-strict sh at all, and the shell dialect never really enters into it. What actually motivates overriding the path is the filesystem — /tmp missing or read-only, or wanting to keep the value as a build artifact. So the comment now reads:

# Timing lands in /tmp by default, which suits CI and Docker. Set
# STATEWAVE_COLD_TIMING_FILE to write elsewhere — e.g. where /tmp is
# missing or read-only, or to keep the value as a build artifact.

2. Restored the trailing newline. The branch had dropped the final newline on exit 1, which showed up as \ No newline at end of file — almost certainly an editor setting. Worth catching because it would have tagged every future diff of this file.

Both are cosmetic; your change is the substance, and the diff is now comment-only. Merging it now.

Thanks again for the steady stream of fixes — they're genuinely useful, and this one closes #297.

@smaramwbc
smaramwbc merged commit 2ce66f4 into smaramwbc:main Aug 5, 2026
6 checks passed
@smaramwbc smaramwbc mentioned this pull request Aug 9, 2026
18 tasks
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.

[Bug]: wait_readyz.sh silently defaults to a hardcoded /tmp path with no documentation

2 participants