Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
More details
The workaround applies only to baseline RxJava 1.0.7 error paths. The latest-dependency suite keeps direct observeOn coverage and strict trace writes.
🤖 Datadog Autotest · Commit 3f85073 · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest
This comment has been minimized.
This comment has been minimized.
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
What Does This Do
Fix intermittent Hystrix observable test timeouts while retaining RxJava 1.0.7 coverage and enabling strict trace writes in both observable test suites.
Why the tests were failing
RxJava 1.0.7 has a race in
observeOnerror handling that can leave its worker spinning insideOperatorObserveOn.pollQueue().The error is stored as a notification in the same queue as ordinary values. The following interleaving can occur:
This explains the seemingly contradictory symptoms: Hystrix delivers its fallback and the spans finish, but the asynchronous task never returns.
The task’s tracing scope consequently remains open, retaining its continuation. Strict trace writes wait for that continuation to be released, and the trace assertion eventually times out.
sequenceDiagram participant P as Producer participant W as RxJava worker participant H as Hystrix participant T as Trace lifecycle W->>W: Enter normal drain path P->>W: Enqueue error notification W->>H: Consume and deliver error H->>H: Execute fallback and finish spans W->>W: Enter error path loop Error notification already consumed W->>W: Poll queue end Note over W,T: Task never returns. scope and continuation remain open T->>T: Strict trace assertion times outThe continuation diagnostic exposed the unfinished task; it was not itself causing the failure. An agent-free reproducer exhibited the same loop on RxJava 1.0.7. Replacing
first()withsingle()also reproduced the hang, so merely waiting for downstream completion was insufficient.What changed
For the baseline error-producing fixtures, transport the error across the scheduler as an ordinary notification:
source.materialize() .observeOn(scheduler) .dematerialize()materialize()converts the error into a value, avoiding the brokenobserveOnerror-draining path.dematerialize()restores the error on the scheduler thread before Hystrix receives it.Coverage tradeoff
The baseline fixtures still run against RxJava 1.0.7, but deliberately avoid its defective native error-draining path. Direct-path coverage remains in the latest-dependency suite.
This avoids upgrading away from the baseline version, weakening trace assertions, or adding production instrumentation to repair an upstream library bug.
Motivation
Additional Notes
Contributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsclose,fix, or any linking keywords when referencing an issueUse
solvesinstead, and assign the PR milestone to the issueJira ticket: [PROJ-IDENT]