Fix gateway recovery epoch replacement boundary - #101
Conversation
Co-Authored-By: Codex <noreply@openai.com>
🤖 Codex PR Review🚫 Merge blocked: 2 serious issue(s) found in high-risk files ⚖️ Codex Review Arbitration🚫 block: The prior blocking issue is fixed in this diff: the initial epoch is now captured via 🚫 Blocking IssuesThese issues must be fixed before this PR can be merged: 1. 🟠 [HIGH] Logic in
|
Co-Authored-By: Codex <noreply@openai.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 15ad6bbe39
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
|
|
||
| line_timestamp = canonical_timestamp(line_timestamp) | ||
| if (line_timestamp == "" || line_timestamp < epoch_timestamp) { |
There was a problem hiding this comment.
Don't drop same-second file log events
When /home/ibgateway/2fa.log or launcher.log emits its normal YYYY-MM-DD HH:MM:SS timestamp during the same second as a replacement whose Docker StartedAt has fractional seconds, canonical_timestamp pads the log line to .000000000, so this < epoch_timestamp check skips it even if it happened after the container started. That makes post-replacement progress or terminal evidence in that first second invisible and can prevent the intended wait extension or terminal veto.
Useful? React with 👍 / 👎.
| line_timestamp = "" | ||
| if ($0 ~ /^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]+)?Z[[:space:]]/) { | ||
| line_timestamp = $1 | ||
| } else if ($0 ~ /^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]+)?[[:space:]]/) { |
There was a problem hiding this comment.
Support IBC launcher millisecond timestamps
When /home/ibgateway/Jts/launcher.log contains IBC's millisecond format YYYY-MM-DD HH:MM:SS:mmm IBC: ... as seen in upstream logs (example), this condition never captures a timestamp because it only allows a dot fraction or whitespace after seconds. Those file-log progress/terminal lines are classified as none, so replacement recovery can skip the intended extension or terminal veto whenever the relevant evidence is only in launcher.log.
Useful? React with 👍 / 👎.
| @@ -0,0 +1,61 @@ | |||
| function canonical_timestamp(value, fraction, digits) { | |||
| if (value ~ /^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]+)?Z$/) { | |||
There was a problem hiding this comment.
Avoid mawk-incompatible timestamp regexes
On hosts where plain awk resolves to mawk (common on Ubuntu/Debian images), this interval regexp with an optional group aborts the classifier with a REcompile() - panic error; because recover_ib_gateway_ready.sh invokes awk directly, replacement log classification then produces no activity instead of detecting progress or terminal events. Use a POSIX-compatible pattern or require gawk so recovery does not silently skip the new epoch policy on those hosts.
Useful? React with 👍 / 👎.
|
PERMANENT_FREEZE / HUMAN_REQUIRED Absolute-final technical adjudication: all three unresolved P2 findings are valid. No further changes, reruns, thread resolution, bypass, merge, or live operations will be performed on this PR. Evidence retained:
Separate live recovery completed naturally with a successful systemd result. This PR was never deployed. |
Summary
StartedAtThis is a fresh reslice from
main; it does not reuse or reopen frozen PRs #99/#100.Tests
python3 -m py_compile 2fa_bot.py scripts/*.pybash -nfor scripts/tests/container overrideactionlintshellcheck --severity=warninggit diff --checkSafety
Code/CI only. No deployment, live restart/recreate, Scheduler invocation,
/run,/dry-run, secrets, account, or trading changes were performed.