File tree 3 files changed +14
-1
lines changed
modules/aggregations/src/internalClusterTest/java/org/elasticsearch/aggregations/bucket
server/src/main/java/org/elasticsearch/tasks
3 files changed +14
-1
lines changed Original file line number Diff line number Diff line change
1
+ pr : 125002
2
+ summary : Don't generate stacktrace in `TaskCancelledException`
3
+ area : Search
4
+ type : bug
5
+ issues : []
Original file line number Diff line number Diff line change 42
42
import static org .elasticsearch .test .hamcrest .ElasticsearchAssertions .assertNoFailures ;
43
43
import static org .hamcrest .Matchers .containsString ;
44
44
import static org .hamcrest .Matchers .equalTo ;
45
+ import static org .hamcrest .Matchers .not ;
45
46
46
47
public class SearchCancellationIT extends AbstractSearchCancellationTestCase {
47
48
@@ -124,7 +125,9 @@ public void testCancellationDuringTimeSeriesAggregation() throws Exception {
124
125
logger .info ("All shards failed with" , ex );
125
126
if (lowLevelCancellation ) {
126
127
// Ensure that we cancelled in TimeSeriesIndexSearcher and not in reduce phase
127
- assertThat (ExceptionsHelper .stackTrace (ex ), containsString ("TimeSeriesIndexSearcher" ));
128
+ assertThat (ExceptionsHelper .stackTrace (ex ), not (containsString ("not building sub-aggregations due to task cancellation" )));
129
+ } else {
130
+ assertThat (ExceptionsHelper .stackTrace (ex ), containsString ("not building sub-aggregations due to task cancellation" ));
128
131
}
129
132
}
130
133
}
Original file line number Diff line number Diff line change @@ -27,6 +27,11 @@ public TaskCancelledException(StreamInput in) throws IOException {
27
27
super (in );
28
28
}
29
29
30
+ @ Override
31
+ public Throwable fillInStackTrace () {
32
+ return this ; // this exception doesn't imply a bug, no need for a stack trace
33
+ }
34
+
30
35
@ Override
31
36
public RestStatus status () {
32
37
// Tasks are typically cancelled at the request of the client, so a 4xx status code is more accurate than the default of 500 (and
You can’t perform that action at this time.
0 commit comments