send request to release search context in finally block to be on the save side
This commit is contained in:
parent
7a082cea4f
commit
ff119f3dff
|
@ -104,11 +104,14 @@ public class TransportSearchDfsQueryAndFetchAction extends TransportSearchTypeAc
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable t) {
|
public void onFailure(Throwable t) {
|
||||||
onSecondPhaseFailure(t, querySearchRequest, shardIndex, dfsResult, counter);
|
try {
|
||||||
// the query might not have been executed at all (for example because thread pool rejected execution)
|
onSecondPhaseFailure(t, querySearchRequest, shardIndex, dfsResult, counter);
|
||||||
// and the search context that was created in dfs phase might not be released.
|
} finally {
|
||||||
// release it again to be in the safe side
|
// the query might not have been executed at all (for example because thread pool rejected execution)
|
||||||
sendReleaseSearchContext(querySearchRequest.id(), node);
|
// and the search context that was created in dfs phase might not be released.
|
||||||
|
// release it again to be in the safe side
|
||||||
|
sendReleaseSearchContext(querySearchRequest.id(), node);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -113,11 +113,14 @@ public class TransportSearchDfsQueryThenFetchAction extends TransportSearchTypeA
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable t) {
|
public void onFailure(Throwable t) {
|
||||||
onQueryFailure(t, querySearchRequest, shardIndex, dfsResult, counter);
|
try {
|
||||||
// the query might not have been executed at all (for example because thread pool rejected execution)
|
onQueryFailure(t, querySearchRequest, shardIndex, dfsResult, counter);
|
||||||
// and the search context that was created in dfs phase might not be released.
|
} finally {
|
||||||
// release it again to be in the safe side
|
// the query might not have been executed at all (for example because thread pool rejected execution)
|
||||||
sendReleaseSearchContext(querySearchRequest.id(), node);
|
// and the search context that was created in dfs phase might not be released.
|
||||||
|
// release it again to be in the safe side
|
||||||
|
sendReleaseSearchContext(querySearchRequest.id(), node);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue