Skip to content
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

SOLR-16343: Handle MDC snapshot being null #978

Closed
wants to merge 1 commit into from

Conversation

dee42
Copy link

@dee42 dee42 commented Aug 18, 2022

https://issues.apache.org/jira/browse/SOLR-16343

Description

With SLF4J 2, MDC context can be null. We need to handle this.

Solution

Ignore the snapshot if it is null

Tests

I tested it fixed my traceback as recorded in the JIRA ticket.

Checklist

Please review the following and check all that apply:

  • I have reviewed the guidelines for How to Contribute and my code conforms to the standards described there to the best of my ability.
  • I have created a Jira issue and added the issue ID to my pull request title.
  • I have given Solr maintainers access to contribute to my PR branch. (optional but recommended)
  • I have developed this patch against the main branch.
  • I have run ./gradlew check.
  • I have added tests for my changes.
  • I have added documentation for the Reference Guide

@risdenk
Copy link
Contributor

risdenk commented Sep 12, 2022

I checked the Javadoc for https://www.slf4j.org/api/org/slf4j/MDC.html#getCopyOfContextMap-- and says it can return null.

@risdenk risdenk self-assigned this Sep 12, 2022
risdenk pushed a commit that referenced this pull request Sep 12, 2022
@risdenk
Copy link
Contributor

risdenk commented Sep 12, 2022

Merged in ae242ff - Thanks @dee42

@risdenk risdenk closed this Sep 12, 2022
risdenk pushed a commit that referenced this pull request Sep 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants