Skip to content

fix(collector): refuse corrupt upload-status instead of resetting counts - #1158

Open
proerror77 wants to merge 1 commit into
mainfrom
cursor/collector-upload-status-fail-closed-1729
Open

fix(collector): refuse corrupt upload-status instead of resetting counts#1158
proerror77 wants to merge 1 commit into
mainfrom
cursor/collector-upload-status-fail-closed-1729

Conversation

@proerror77

@proerror77 proerror77 commented Sep 12, 2026

Copy link
Copy Markdown
Owner

Change

Corrupt upload-status.json is now fail-closed instead of defaulting to {} and resetting failure_count. Shared read_status in Polymarket, LOB read_upload_status, and the Bybit local copy refuse invalid JSON / non-objects / bad failure_count. A missing file is still an empty map. Collectors that inherit those readers (binance-lob-archiver, fee, usdm-reference) get the same gate.

Issue relationship

None

Validation

cargo test -p hft-collector --locked corrupt_upload_status
cargo test -p hft-collector --locked upload_status_must_be_valid

Rebased onto current main after #1154.

Runtime impact and rollback

Collector upload-status parsing only. After the next collector deploy, a corrupt status file fails instead of looking freshly healthy. Rollback is the previous collector binaries. Not a live trading change.

Open in Web Open in Cursor 

@coderabbitai

coderabbitai Bot commented Sep 12, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: c9deb744-019b-476c-aec4-76c3a673edb3


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@proerror77
proerror77 marked this pull request as ready for review September 12, 2026 04:50
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 12, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-12T04:53:21.779473Z 64fbbac Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.


#[test]
fn corrupt_upload_status_does_not_default_failure_count() {
let root = std::env::temp_dir().join(format!(
@cursor
cursor Bot force-pushed the cursor/collector-upload-status-fail-closed-1729 branch from 64fbbac to 52aa07f Compare September 12, 2026 05:16
Fee, USD-M reference, LOB, and Bybit uploaders now fail closed on
invalid upload-status.json instead of treating it as an empty object
and writing failure_count back to zero. Missing files still start
clean; existing corrupt bytes are left untouched.

Co-authored-by: Wild Card <proerror77@users.noreply.github.com>
@cursor
cursor Bot force-pushed the cursor/collector-upload-status-fail-closed-1729 branch from 52aa07f to 6003b18 Compare September 12, 2026 05:44
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.

3 participants