-
Notifications
You must be signed in to change notification settings - Fork 344
rxjava-3.0 async blind regeneration for #11927 #11939
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,36 +1,24 @@ | ||
|
|
||
| muzzle { | ||
| pass { | ||
| group = "io.reactivex.rxjava3" | ||
| module = "rxjava" | ||
| versions = "[3.0.0,)" | ||
| } | ||
| // Assert the rxjava3 advice never resolves against rxjava2 — the two namespaces | ||
| // must not overlap. rxjava3 references io.reactivex.rxjava3.core.*, absent from the | ||
| // rxjava2 artifact, so muzzle must fail to match it. | ||
| fail { | ||
| name = "rxjava2-must-not-match" | ||
| group = "io.reactivex.rxjava2" | ||
| module = "rxjava" | ||
| versions = "[2.0.0,)" | ||
| } | ||
| } | ||
|
|
||
| apply from: "$rootDir/gradle/java.gradle" | ||
|
|
||
| addTestSuiteForDir('latestDepTest', 'test') | ||
|
|
||
| dependencies { | ||
| compileOnly group: 'org.reactivestreams', name: 'reactive-streams', version: '1.0.3' | ||
| compileOnly group: 'org.reactivestreams', name: 'reactive-streams', version: '1.0.0' | ||
| compileOnly group: 'io.reactivex.rxjava3', name: 'rxjava', version: '3.0.0' | ||
|
|
||
| testImplementation project(':dd-java-agent:instrumentation:datadog:tracing:trace-annotation') | ||
| testImplementation project(':dd-java-agent:instrumentation:opentelemetry:opentelemetry-annotations-1.20') | ||
|
|
||
| testImplementation group: 'io.reactivex.rxjava3', name: 'rxjava', version: '3.0.0' | ||
| testImplementation group: 'io.opentelemetry.instrumentation', name: 'opentelemetry-instrumentation-annotations', version: '1.28.0' | ||
|
|
||
| // Load the rxjava2 instrumenter at test runtime to prove the two versions coexist on | ||
| // the agent without interference (it stays dormant with only rxjava3 on the classpath). | ||
| testRuntimeOnly project(':dd-java-agent:instrumentation:rxjava:rxjava-2.0') | ||
|
|
||
| latestDepTestImplementation group: 'io.reactivex.rxjava3', name: 'rxjava', version: '+' | ||
| latestDepTestImplementation group: 'io.reactivex.rxjava3', name: 'rxjava', version: '3.+' | ||
| } | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -13,40 +13,39 @@ | |||||
| @AutoService(InstrumenterModule.class) | ||||||
| public final class RxJavaModule extends InstrumenterModule.ContextTracking { | ||||||
| public RxJavaModule() { | ||||||
| super("rxjava", "rxjava-3"); | ||||||
| super("rxjava"); | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
With only Useful? React with 👍 / 👎.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Any customer who disabled rxjava3 instrumentation with DD_TRACE_RXJAVA_3_ENABLED=false will have it involuntarily re-enabled after upgrading to an agent built from this diff. Assertion details
Was this helpful? React 👍 or 👎
Suggested change
|
||||||
| } | ||||||
|
|
||||||
| @Override | ||||||
| public String[] helperClassNames() { | ||||||
| return new String[] { | ||||||
| packageName + ".TracingCompletableObserver", | ||||||
| packageName + ".TracingObserver", | ||||||
| packageName + ".TracingSubscriber", | ||||||
| packageName + ".TracingSingleObserver", | ||||||
| packageName + ".TracingMaybeObserver", | ||||||
| packageName + ".TracingObserver", | ||||||
| packageName + ".TracingCompletableObserver", | ||||||
| packageName + ".RxJavaAsyncResultExtension", | ||||||
| packageName + ".TracingSingleObserver", | ||||||
| }; | ||||||
| } | ||||||
|
|
||||||
| @Override | ||||||
| public Map<String, String> contextStore() { | ||||||
| String contextClass = Context.class.getName(); | ||||||
| final Map<String, String> store = new HashMap<>(); | ||||||
| store.put("io.reactivex.rxjava3.core.Flowable", contextClass); | ||||||
| store.put("io.reactivex.rxjava3.core.Completable", contextClass); | ||||||
| store.put("io.reactivex.rxjava3.core.Maybe", contextClass); | ||||||
| store.put("io.reactivex.rxjava3.core.Observable", contextClass); | ||||||
| store.put("io.reactivex.rxjava3.core.Single", contextClass); | ||||||
| store.put("io.reactivex.rxjava3.core.Observable", Context.class.getName()); | ||||||
| store.put("io.reactivex.rxjava3.core.Flowable", Context.class.getName()); | ||||||
| store.put("io.reactivex.rxjava3.core.Single", Context.class.getName()); | ||||||
| store.put("io.reactivex.rxjava3.core.Maybe", Context.class.getName()); | ||||||
| store.put("io.reactivex.rxjava3.core.Completable", Context.class.getName()); | ||||||
| return store; | ||||||
| } | ||||||
|
|
||||||
| @Override | ||||||
| public List<Instrumenter> typeInstrumentations() { | ||||||
| return asList( | ||||||
| new CompletableInstrumentation(), | ||||||
| new ObservableInstrumentation(), | ||||||
| new FlowableInstrumentation(), | ||||||
| new SingleInstrumentation(), | ||||||
| new MaybeInstrumentation(), | ||||||
| new ObservableInstrumentation(), | ||||||
| new SingleInstrumentation()); | ||||||
| new CompletableInstrumentation()); | ||||||
| } | ||||||
| } | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removes the build-time safety net preventing rxjava3 instrumentation from being applied to rxjava2 classes; namespace-separation bugs can silently reach production.
Assertion details
CI muzzle task fails with 'rxjava2-must-not-match' assertion, blocking the mergeWithout the fail block, muzzle only checks the pass case. The namespace-separation constraint is undocumented and unverified; the accidental match would reach production undetected.Was this helpful? React 👍 or 👎
🤖 Datadog Autotest · What is Autotest? · Any feedback? Reach out in #autotest