Skip to content

Conversation

@JonasKunz
Copy link
Contributor

@JonasKunz JonasKunz commented Aug 17, 2023

What does this PR do?

While enhancing the kafka tests I noticed a strange behaviour: The kafka instrumentation would stop correctly ending transaction if the initial context is baggage without a span / transaction.

This was due to the implementation of ActiveStak.currentTransaction() which relies on the transaction being the first element on the stack.

This is not always true in case of baggage, but also was wrong prior to the baggage addition in cases where a nested transaction shadows the original one.

The tests (except for the one fixed in this pr) remain green, therefor I assume there should be no bad side effects.

Checklist

  • This is a bugfix
@JonasKunz JonasKunz added the ci:jdk-compatibility Enables JDK compatibility tests in build pipeline label Aug 17, 2023
@JonasKunz JonasKunz requested a review from a team August 17, 2023 14:27
@JonasKunz JonasKunz enabled auto-merge (squash) August 25, 2023 08:58
@JonasKunz JonasKunz merged commit 3a2163e into elastic:main Aug 25, 2023
@JonasKunz JonasKunz deleted the fix-current-tx branch August 25, 2023 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-java ci:jdk-compatibility Enables JDK compatibility tests in build pipeline

2 participants