File tree Expand file tree Collapse 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 Expand file tree Collapse file tree 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 4242import static org .elasticsearch .test .hamcrest .ElasticsearchAssertions .assertNoFailures ;
4343import static org .hamcrest .Matchers .containsString ;
4444import static org .hamcrest .Matchers .equalTo ;
45+ import static org .hamcrest .Matchers .not ;
4546
4647public class SearchCancellationIT extends AbstractSearchCancellationTestCase {
4748
@@ -124,7 +125,9 @@ public void testCancellationDuringTimeSeriesAggregation() throws Exception {
124125 logger .info ("All shards failed with" , ex );
125126 if (lowLevelCancellation ) {
126127 // 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" ));
128131 }
129132 }
130133}
Original file line number Diff line number Diff line change @@ -27,6 +27,11 @@ public TaskCancelledException(StreamInput in) throws IOException {
2727 super (in );
2828 }
2929
30+ @ Override
31+ public Throwable fillInStackTrace () {
32+ return this ; // this exception doesn't imply a bug, no need for a stack trace
33+ }
34+
3035 @ Override
3136 public RestStatus status () {
3237 // 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