Repository navigation
fix(hylafax): check engine lines cheaply every round, without faxstat per line - #127
Merged
Merged
Conversation
Issue #86 was seen through `faxbot status`, which reads the outbound board (GET /outbound/now), and `faxbot status ID`, which reads GET /fax/{id}; the HTTP settle test checked only Sent's details (GET /admin/fax-jobs/{id}). The test now checks all three before and after settling through POST /certainty/items/{id}/settle: before, each shows "Needs review" and the board lists the fax under needs_you; after, both fax reads show the settled state with no review notice, and the board no longer lists it. One board aggregate serves every viewer for outbound_now.AGGREGATE_SECONDS (2 seconds), so the test drops the cached aggregate before its second board read, as the next poll would see it; test_outbound_now.py does the same. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Issue #81 asks that the engine's supervisor check more cheaply without reporting a stopped line later than it did when the issue was filed. At that time every 5-second round ran pgrep and faxstat. The cheaper check that followed (remembered process IDs and the status files) ran only every 25 seconds, so a stopped faxgetty, faxq, hfaxd or modem could go unnoticed for up to 25 seconds, and a line that was not ready for up to about 75. That check starts no process (kill -0, the builtin read of /proc and the status files, a test for each line's device), so it now runs every round. pgrep, and faxstat once for whether a call is up, still run only when it finds something wrong. Reading the iaxmodem logs for a refused registration and reading the session logs start processes, so they stay on the 25-second round (FAXBOT_ENGINE_LIVENESS_SECONDS). The tests for a stopped faxgetty, faxq or hfaxd, a lost modem and a line that stops being ready now set the slow round to 30 seconds and expect the report within a few seconds. On the previous head all ten fail. The README drops the "0.86% of one core instead of 1.54%" figure, because no record of that measurement exists. It now says plainly that the processor saving has not been measured. It also drops the developer wording added to the SIP carrier feature line; the roadmap entry covers the supervisor. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # README.md
DMontgomery40
marked this pull request as ready for review
October 30, 2026 20:20
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
…-81 (merge train: #126 lands first)
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SSL Fax engine supervisor: cheap checks every round, no faxstat per line
Issue #81 asks the SSL Fax engine's supervisor (
hylafax/entrypoint.sh) to check its daemons and lines more cheaply, without noticing a dead daemon, or a line that lost its faxgetty, later than it did when the issue was filed. At that time every 5-second round ran pgrep four times andfaxstat -sonce per line. Main has since replaced that with a cheap check: remembered process IDs asked withkill -0, and each line's status file. That check ran only every 25 seconds, though, and startup and recovery still askedfaxstatonce per line.This branch has two commits:
line_statereadsstatus/ttyIAXn(the file faxgetty keeps andfaxstatreads) with the builtinread, instead of runningfaxstat -sonce per line. Startup (lines_ready), recovery (check_lines) and the cheap check (looks_whole) now share it.idle()still asksfaxstatonce, only before a restart.kill -0, the builtinreadof/proc/<pid>/statand the status files,[ -e ]), so it now runs every 5-second round, not every 25 seconds. pgrep, andfaxstatonce for whether a call is up, still run only when it finds something wrong. Reading the iaxmodem logs for a refused registration and reading the session logs start processes, so they stay on the 25-second round (FAXBOT_ENGINE_LIVENESS_SECONDS).Compared with when the issue was filed:
Two trade-offs to judge:
README: the roadmap entry for the SSL Fax engine now gives the 5-second check, what it reads, and what stays on the 25-second round. I removed the "0.86% of one core instead of 1.54%" figure that was on main, because no record of that measurement exists in the repository. The README now says plainly that the processor saving has not been measured. I also reverted the developer wording the first commit added to the SIP carrier feature line; the roadmap covers it.
Checks on this head (4f42dd2, on main 7446857)
bash -n hylafax/entrypoint.sh: OK.make test-local PYTEST_ARGS='tests/test_hylafax_scripts.py tests/test_hylafax_engine.py tests/test_sip_compose.py tests/test_polling.py tests/test_measured_codec.py': 217 passed, 18 skipped. The skips are the PostgreSQL variants of the shareddatabasefixture. No PostgreSQL URL was given because this is not a schema change; CI runs them.make test-local PYTEST_ARGS='tests/test_hylafax_scripts.py'on f725773 before my commit: 38 passed.entrypoint.shover the branch file and ran-k "without_starting_faxstat or stops_being_ready". Result: 4 failed, 3 passed. The start test failed, and so did the three variants wherefaxstatdoes not list idle lines. I restored the file withgit checkout.entrypoint.sh, all 10 failed; the session-log test passed. All pass on this head. The test that no pgrep or faxstat runs while the lines are whole still guards the no-process claim.Not checked
test_hylafax_scripts.py.FAXBOT_SSLFAX_PROOF) was not run.status/ttyIAXndirectly assumes faxgetty's status file holds the same textfaxstat -sshows. Main's cheap check already relied on this, but it has not been checked against a real engine here.Pre-existing failures
None found in the suites run.
Closes #81
🤖 Generated with Claude Code