Repository navigation
Conversation
MispClientBlocking owns a dedicated tokio::runtime::Runtime and every method calls Runtime::block_on internally (see e.g. src/client_blocking.rs:167). Per tokio's own documentation, block_on panics with "Cannot start a runtime from within a runtime" when called from a thread already inside an async execution context, and dropping a Runtime from such a context panics as well. The type had no documentation warning callers about this, unlike reqwest::blocking, which documents the identical constraint prominently (https://docs.rs/reqwest/latest/reqwest/blocking/index.html). This is a Rust-runtime/API-usage concern, not a MISP wire-protocol behavior, so it is not something the pinned MISP core controllers or PyMISP encode one way or another; reqwest::blocking's documented behavior (cited in the finding) is the correct reference to mirror, and this change does so. Adds a "# Panics" section to the MispClientBlocking struct doc and to the client_blocking module doc in lib.rs, mirroring reqwest::blocking's wording. Docs-only, no behavior change. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JoSButbVaWEtGMXwTx73BZ
elhoim
marked this pull request as draft
September 3, 2026 05:05
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.
BLUF — Documents that
MispClientBlockingpanics when used from inside an async runtime.MispClientBlockinginsrc/client_blocking.rsowns atokio::runtime::Runtimeand callsblock_onin every method, so calling or dropping it inside an existing runtime panics with "Cannot start a runtime from within a runtime".reqwest::blockingdocuments this; this did not.# Panicssection to theMispClientBlockingstruct doc and to theclient_blockingmodule doc insrc/lib.rs, mirroringreqwest::blocking's wording.ubuntu-22.04runner lacks php8.3mod_php;test_event_crud_lifecycleraces the publish worker), fixed in unmerged PR fix: [ci] Run integration tests on ubuntu-24.04 to match php8.3 #53 and unrelated to this change.Finding
MispClientBlocking panics inside an async runtime with no warning
It owns a tokio Runtime; any method call from inside an existing runtime panics with 'Cannot start a runtime from within a runtime', and dropping it in async context panics too. reqwest::blocking documents this; this does not.
Change
Confirmed MispClientBlocking (src/client_blocking.rs) owns a dedicated tokio::runtime::Runtime and every method calls Runtime::block_on (e.g. line 167 onward), with no custom Drop impl. tokio documents that block_on panics with "Cannot start a runtime from within a runtime" when invoked from a thread already inside an async execution context, and that dropping a Runtime there panics too, matching the finding exactly. Added a "# Panics" doc section to the MispClientBlocking struct in client_blocking.rs and to the client_blocking module doc in lib.rs, mirroring reqwest::blocking's documented wording and cross-referencing it. Docs-only change, no code/behavior modified.
Upstream evidence
Not applicable to MISP core / PyMISP: this finding concerns Rust async-runtime semantics (tokio's block_on/Drop panic behavior), not MISP wire protocol or controller/model behavior, so the pinned MISP controller and PyMISP sources contain no relevant evidence either way. The finding itself names the correct reference to mirror: reqwest::blocking (https://docs.rs/reqwest/latest/reqwest/blocking/index.html), which documents the identical "cannot call/drop from within a runtime" constraint for its own Runtime-wrapping blocking client; the wording added here mirrors that documented behavior.
Verified against MISP core
843b6744and PyMISPe7debb4f.Tests
No runnable test: this is a docs/CI-only change, or the affected test requires a live MISP instance.
Caveats
Pure documentation change (added "# Panics" sections to MispClientBlocking's struct doc and the client_blocking module doc in lib.rs). No code behavior changed, no test suite run (per task instructions, cargo build/test/clippy were not invoked; only cargo fmt was run). The upstream MISP/PyMISP pinned references are not applicable to this finding since it is a Rust-runtime API-misuse concern, not a MISP wire-protocol issue.
Verified locally:
cargo fmt --check,cargo clippy --all-targets --all-features -- -D warnings,cargo test --all-features --lib,--test integration_tests --no-run, andcargo check --examples, each in an isolated target directory.🤖 Generated with Claude Code