fix(core): drain provider pipes while waiting for timeout#38
Closed
JSONbored wants to merge 1 commit into
Closed
Conversation
Owner
Author
|
Closing as superseded by #40, which merged the provider execution hardening along with the consolidated security fixes. This branch also has a failing DCO check, so keeping it open would only add noise. |
Owner
Author
|
Superseded by #40. |
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.
Motivation
stdout/stderr, which can deadlock when a provider emits more data than the OS pipe buffer and causes findings to be lost.provider_execution_failedsignal, allowing explicitly enabled providers to be silently bypassed by large outputs.Description
stdoutandstderrconcurrently by spawning reader threads thatread_to_end(withtake-based caps) immediately after spawning the provider, and join those threads afterwait_timeoutreturns.stdoutexceeds the configured cap or the provider times out.use std::thread;and update the provider contract test to invoke/bin/sleepunder an isolatedPATHand to include the actual error text in the assertion message.crates/nightward-core/src/providers.rsandcrates/nightward-core/tests/provider_contracts.rs.Testing
cargo test -p nightward-core, which executes the unit tests andprovider_contractstest suite.provider_contractstests (includingprovider_timeout_returns_stable_warning_errorandprovider_stdout_cap_fails_closed_before_parsing) passed after the changes.Codex Task