Skip to content

Fixed PR from my prev PR #574#578

Open
shramanb113 wants to merge 3 commits intointernetarchive:mainfrom
shramanb113:fix/early-return-body-discard-pr
Open

Fixed PR from my prev PR #574#578
shramanb113 wants to merge 3 commits intointernetarchive:mainfrom
shramanb113:fix/early-return-body-discard-pr

Conversation

@shramanb113
Copy link
Copy Markdown

Summary

This PR improves the reliability and scalability of the archiver by removing
fragile timing assumptions, eliminating dead code execution, and replacing
a spin-wait in the rate limiter.

Changes

  • Replaces a time.Sleep used to avoid a known race condition between
    router.Run() and page.Navigate() with a deterministic synchronization
    mechanism.

  • When asset capture and crawling are disabled, the response body was fully
    discarded but processing continued, leading to MIME detection and buffering
    on an already-consumed stream. An early return is added to avoid unnecessary
    work and ensure correct behavior.

  • Replaces a busy-wait loop that periodically re-acquired a mutex with a
    time-based wait calculated from the token refill rate.

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.

1 participant