Commit 6d99d7d
authored
ListenableFuture should preserve ThreadContext (#34394)
ListenableFuture may run a listener on the same thread that called the
addListener method or it may execute on another thread after the future
has completed. Whenever the ListenableFuture stores the listener for
execution later, it should preserve the thread context which is what
this change does.1 parent 7bc11a8 commit 6d99d7d
File tree
4 files changed
+31
-9
lines changed- server/src
- main/java/org/elasticsearch/common/util/concurrent
- test/java/org/elasticsearch/common/util/concurrent
- x-pack/plugin/security/src
- main/java/org/elasticsearch/xpack/security/authc/support
- test/java/org/elasticsearch/xpack/security/authc/support
4 files changed
+31
-9
lines changedLines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
50 | | - | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| |||
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
62 | | - | |
| 63 | + | |
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
| |||
Lines changed: 20 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| 34 | + | |
| 35 | + | |
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
| 39 | + | |
36 | 40 | | |
37 | 41 | | |
38 | 42 | | |
| |||
46 | 50 | | |
47 | 51 | | |
48 | 52 | | |
49 | | - | |
| 53 | + | |
50 | 54 | | |
51 | 55 | | |
52 | 56 | | |
| |||
63 | 67 | | |
64 | 68 | | |
65 | 69 | | |
66 | | - | |
| 70 | + | |
67 | 71 | | |
68 | 72 | | |
69 | 73 | | |
| |||
76 | 80 | | |
77 | 81 | | |
78 | 82 | | |
79 | | - | |
| 83 | + | |
80 | 84 | | |
81 | 85 | | |
82 | 86 | | |
| |||
85 | 89 | | |
86 | 90 | | |
87 | 91 | | |
| 92 | + | |
88 | 93 | | |
89 | 94 | | |
90 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
91 | 101 | | |
| 102 | + | |
92 | 103 | | |
| 104 | + | |
93 | 105 | | |
| 106 | + | |
94 | 107 | | |
| 108 | + | |
95 | 109 | | |
96 | 110 | | |
97 | 111 | | |
98 | | - | |
| 112 | + | |
99 | 113 | | |
100 | 114 | | |
101 | | - | |
| 115 | + | |
| 116 | + | |
102 | 117 | | |
103 | 118 | | |
104 | 119 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | | - | |
| 156 | + | |
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
| |||
255 | 255 | | |
256 | 256 | | |
257 | 257 | | |
258 | | - | |
| 258 | + | |
259 | 259 | | |
260 | 260 | | |
261 | 261 | | |
| |||
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
469 | 469 | | |
470 | 470 | | |
471 | 471 | | |
| 472 | + | |
472 | 473 | | |
| 474 | + | |
473 | 475 | | |
474 | 476 | | |
475 | 477 | | |
476 | 478 | | |
477 | 479 | | |
478 | 480 | | |
479 | 481 | | |
| 482 | + | |
480 | 483 | | |
481 | 484 | | |
482 | 485 | | |
| |||
529 | 532 | | |
530 | 533 | | |
531 | 534 | | |
| 535 | + | |
532 | 536 | | |
533 | 537 | | |
| 538 | + | |
534 | 539 | | |
535 | 540 | | |
536 | 541 | | |
537 | 542 | | |
| 543 | + | |
538 | 544 | | |
539 | 545 | | |
540 | 546 | | |
| |||
0 commit comments