You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by ho...@apache.org on 2024/03/28 14:27:32 UTC

(solr) branch main updated: SOLR-17218: Fix indexFetcher logging to include MDC details

This is an automated email from the ASF dual-hosted git repository.

hossman pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/main by this push:
     new 418dc06f24e SOLR-17218: Fix indexFetcher logging to include MDC details
418dc06f24e is described below

commit 418dc06f24ecb8b99138e05ec5c38eeb0f1b0068
Author: Chris Hostetter <ho...@apache.org>
AuthorDate: Thu Mar 28 09:26:42 2024 -0500

    SOLR-17218: Fix indexFetcher logging to include MDC details
---
 solr/CHANGES.txt                                                   | 2 ++
 solr/core/src/java/org/apache/solr/handler/ReplicationHandler.java | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 7001eb0232b..8585748e5a1 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -156,6 +156,8 @@ Bug Fixes
 
 * SOLR-17200: Fix false positive race condition in `/health?requireHealthyCores=true` during core loading (hossman)
 
+* SOLR-17218: Fix indexFetcher logging to include MDC details (hossman)
+
 Dependency Upgrades
 ---------------------
 
diff --git a/solr/core/src/java/org/apache/solr/handler/ReplicationHandler.java b/solr/core/src/java/org/apache/solr/handler/ReplicationHandler.java
index 02d6745b234..78e37646e89 100644
--- a/solr/core/src/java/org/apache/solr/handler/ReplicationHandler.java
+++ b/solr/core/src/java/org/apache/solr/handler/ReplicationHandler.java
@@ -1214,9 +1214,10 @@ public class ReplicationHandler extends RequestHandlerBase
       log.info(" No value set for 'pollInterval'. Timer Task not started.");
       return;
     }
-
+    final Map<String, String> context = MDC.getCopyOfContextMap();
     Runnable task =
         () -> {
+          MDC.setContextMap(context);
           if (pollDisabled.get()) {
             log.info("Poll disabled");
             return;