Skip to content

Conversation

@SylvainJuge
Copy link
Member

@SylvainJuge SylvainJuge commented Apr 1, 2021

What does this PR do?

Improves previous fix #1715 as there was another direct writing to JMS message not covered.

Checklist

  • This is a bugfix
span.withName("JMS SEND to ");
addDestinationDetails(null, destination, destinationName, span);
if (isDestinationNameComputed) {
message.setStringProperty(JMS_DESTINATION_NAME_PROPERTY, destinationName);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the offending writing call was right here.

logger.debug("Failed to set JMS message property {} due to read-only message", headerName, e);
} catch (JMSException e) {
logger.warn("Failed to set JMS message property. Distributed tracing cannot work without that.");
logger.warn("Failed to set JMS message property {}.", headerName);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here the name of the property will make it obvious to know the case and if it's related to distributed tracing or not.
Now this is also used to add the destination name for the receiver side.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not for us, it's for the user who doesn't necessarily knows this property is related to distributed tracing. In addition, this message is still valid - if we can't set a property, distributed tracing will not work. We can say "Distributed tracing may not work..." instead.


public class JmsInstrumentationHelper {

private static final JmsMessagePropertyAccessor MSG_ACCESSOR = JmsMessagePropertyAccessor.instance();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[minor] It's already a singleton, I don't think it makes sense to hold a reference to it

logger.debug("Failed to set JMS message property {} due to read-only message", headerName, e);
} catch (JMSException e) {
logger.warn("Failed to set JMS message property. Distributed tracing cannot work without that.");
logger.warn("Failed to set JMS message property {}.", headerName);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not for us, it's for the user who doesn't necessarily knows this property is related to distributed tracing. In addition, this message is still valid - if we can't set a property, distributed tracing will not work. We can say "Distributed tracing may not work..." instead.

@ghost
Copy link

ghost commented Apr 1, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: Pull request #1730 updated

  • Start Time: 2021-04-13T08:37:23.546+0000

  • Duration: 54 min 26 sec

  • Commit: dc9302e

Test stats 🧪

Test Results
Failed 0
Passed 1984
Skipped 19
Total 2003

Trends 🧪

Image of Build Times

Image of Tests

💚 Flaky test report

Tests succeeded.

Expand to view the summary

Test stats 🧪

Test Results
Failed 0
Passed 1984
Skipped 19
Total 2003

@SylvainJuge SylvainJuge merged commit 319f472 into elastic:master Apr 13, 2021
@SylvainJuge SylvainJuge deleted the always-write-jms-safely branch April 13, 2021 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants