Repository navigation
Conversation
This comment has been minimized.
This comment has been minimized.
Contributor
🟢 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. |
This branch has not been deployed
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.
What does this PR do?
Adds a diagnostic Tier-1 formal-methods suite and concrete regression/stress repros for lifecycle, ownership, flush, retry, fan-out, and shutdown failures in the tracer.
This remains a diagnostic draft. It intentionally contains no production fixes. Known-bug models are expected to produce their documented invariant violations, and the corresponding regression/stress tests expose the current implementation behavior.
The suite uses three complementary techniques:
Executive summary
The investigation has confirmed 11 distinct counterexamples across pending traces, writer flush semantics, remote configuration, telemetry, Data Streams shutdown, and concurrent lifecycle barriers.
The recurring problem is that an acknowledgement is not always bound to all of the work it claims to acknowledge. Examples include a flush marker covering one queue but not upstream/secondary work, a shared counter acknowledging another caller's flush, and remote-config state being treated as globally applied after only partial listener delivery.
These tests prove that the faulty implementation schedules are reachable. They do not establish how frequently customers encounter them.
Suggested priority
These are relative engineering-triage recommendations, not incident-severity declarations.
PUBLISH_SECONDARY -> FLUSHacknowledges the primary marker before visiting the secondary queueflushCounter; one marker can release the other caller before its element is writtenacceptremovecommitclose()can return with the worker aliveSEND_FAILURE -> ADD -> SEND_SUCCESSretries an empty buffer instead of the new eventmoreDatais falsely reported asfalseRemote-config findings are correctness defects. Their security significance depends on the affected product/listener; this investigation has not demonstrated a security exploit.
Findings and evidence
1. Single-span-sampling flush bypass
TraceProcessingWorker.flush()places its barrier directly in the primary serialization queue without first synchronizing with the upstreamSpanSamplingWorker.formal-methods/span-sampling-flush/SpanSamplingFlush.tlaFlushCoversAcceptedCandidateTraceProcessingWorkerTest.flushWaitsForInFlightSingleSpanSampling2. Pending-trace flush leaves stale queue ownership
The normal worker path clears
isEnqueuedbefore writing.WriteDrain.acceptwrites without clearing it, so a later child finish cannot requeue the trace.formal-methods/pending-trace-flush/FlushDrainOwnership.tlaPendingChildHasWriterPendingTraceBufferTest.flushDrainClearsEnqueuedStateBeforeWriting3. Writer secondary queue bypasses flush
The generated writer state machine records every trace accepted before a flush. The minimal counterexample is:
The serializer observes and acknowledges the primary marker before consuming the already accepted secondary trace.
TraceProcessingWorkerStateMachineTest.generatedCommandSequencesRespectFlushBarriers4. Concurrent pending-trace flush callers share an acknowledgement
One JCStress actor invokes
flush(). A second actor enqueues an element, invokesflush(), and records the element's write count when its call returns.Forbidden result:
PendingTraceBufferConcurrentFlushStressTestflushCountervalue instead of waiting for an acknowledgement tied to their own marker5-7. Remote-config listener fan-out failures
The fault-injection state machine places a throwing listener before a healthy listener and injects failure independently into:
It then replays identical remote state. In every phase the healthy listener misses the operation, while cached state reports no change and prevents retry.
formal-methods/remote-config-listeners/ListenerDistribution.tlaProductStateSpecification.listenerFailureDoesNotPreventLaterListenersFromReceivingConfigurationProductStateListenerStateMachineTest.generatedListenerFailuresRemainRetryableForHealthyListeners8. Data Streams shutdown poison pill can be rejected
When the bounded inbox is full, the shutdown
POISON_PILLoffer can fail.close()then waits for the join timeout and can return while the worker remains alive.formal-methods/data-streams-close/DataStreamsClose.tlaDefaultDataStreamsMonitoringTest.closeStopsWorkerWhenInboxIsFull9. Full long-running tracker loses trace ownership
LongRunningTracesTracker.addtransitionsTO_TRACK -> TRACKED, butaddTracedrops at capacity andaddstill reports acceptance. The pending-buffer worker therefore skips its fallback path.formal-methods/long-running-traces/TrackerOwnership.tlaLiveTraceHasOwnerLongRunningTracesTrackerTest.fullTrackerLeavesOverflowTraceForBufferFallback10. Flush consumes tracer-flare dump marker
FLUSH_ELEMENTbulk-drains subsequent elements throughElement.write().DUMP_ELEMENThas a no-opwrite(), so its marker disappears without incrementingdumpCounter.formal-methods/flush-dump-marker/FlushDumpMarker.tlaWaitingDumpHasOwnerPendingTraceBufferTest.flushDrainDoesNotConsumeTracerDumpMarker11. Empty telemetry retry masks a newly queued event
The generated telemetry state machine extracts event identifiers from the real serialized request body and compares them with a queued/retry/delivered reference model.
Minimal counterexample:
The first empty failed request creates an empty retry buffer. The next send retries that empty buffer instead of taking the new event, then reports
falseeven though the event remains queued.formal-methods/telemetry-retry/TelemetryRetryOwnership.tlaTelemetryServiceStateMachineTest.generatedRetrySequencesPreserveAcceptedEventOwnershipPositive evidence
Not every explored protocol failed.
The bounded continuation lifecycle model passes, and two JCStress probes cover:
releaseracing withresume + close;resume + closeoperations racing withrelease.All 156 JVM/compiler configurations observed exactly one finalization: no continuation leak and no double finalization. This is narrow positive evidence for that counter protocol, not proof of unrelated scope-manager behavior.
Method and contract vocabulary
Every modeled asynchronous handoff identifies:
The central contracts are:
Generated implementation state machines follow three rules:
Recurring failure patterns
Validation
git diff --checkpasses.What has and has not been established
Established:
Not established:
Recommended next experiments
The highest-yield next step is a systematic control-message saturation audit:
offer(STOP), poison-pill, flush, report, and dump operations;flush()orclose();Then:
flushversusclose, multiple writer flush callers, and more continuation schedules;Scope and review intent
This PR establishes reproducible evidence and helps decide fix order. It contains formal models, run documentation, generated state-machine tests, deterministic regressions, and JCStress probes. It deliberately contains no production fixes and should remain draft / do-not-merge until findings are split or fixed.