File tree 1 file changed +13
-7
lines changed
core/src/main/java/org/elasticsearch/index/seqno
1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change 35
35
import org .elasticsearch .cluster .service .ClusterService ;
36
36
import org .elasticsearch .common .inject .Inject ;
37
37
import org .elasticsearch .common .settings .Settings ;
38
+ import org .elasticsearch .common .util .concurrent .ThreadContext ;
38
39
import org .elasticsearch .index .shard .IndexShard ;
39
40
import org .elasticsearch .index .shard .IndexShardClosedException ;
40
41
import org .elasticsearch .index .shard .ShardId ;
@@ -80,13 +81,18 @@ public GlobalCheckpointSyncAction(
80
81
}
81
82
82
83
public void updateGlobalCheckpointForShard (final ShardId shardId ) {
83
- execute (
84
- new Request (shardId ),
85
- ActionListener .wrap (r -> {}, e -> {
86
- if (ExceptionsHelper .unwrap (e , AlreadyClosedException .class , IndexShardClosedException .class ) == null ) {
87
- logger .info (new ParameterizedMessage ("{} global checkpoint sync failed" , shardId ), e );
88
- }
89
- }));
84
+ final ThreadContext threadContext = threadPool .getThreadContext ();
85
+ try (ThreadContext .StoredContext ignore = threadContext .stashContext ()) {
86
+ threadContext .markAsSystemContext ();
87
+ execute (
88
+ new Request (shardId ),
89
+ ActionListener .wrap (r -> {
90
+ }, e -> {
91
+ if (ExceptionsHelper .unwrap (e , AlreadyClosedException .class , IndexShardClosedException .class ) == null ) {
92
+ logger .info (new ParameterizedMessage ("{} global checkpoint sync failed" , shardId ), e );
93
+ }
94
+ }));
95
+ }
90
96
}
91
97
92
98
@ Override
You can’t perform that action at this time.
0 commit comments