Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Treat TransportService stopped error as node is closing #39800

Merged
merged 3 commits into from
Mar 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,9 @@ public String toString() {
private void onNoLongerPrimary(Exception failure) {
final Throwable cause = ExceptionsHelper.unwrapCause(failure);
final boolean nodeIsClosing = cause instanceof NodeClosedException
|| (cause instanceof TransportException && "TransportService is closed stopped can't send request".equals(cause.getMessage()));
|| (cause instanceof TransportException &&
("TransportService is closed stopped can't send request".equals(cause.getMessage())
|| "transport stopped, action: internal:cluster/shard/failure".equals(cause.getMessage())));
final String message;
if (nodeIsClosing) {
message = String.format(Locale.ROOT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,11 @@ public void testNoLongerPrimary() throws Exception {
shardActionFailure = new NodeClosedException(new DiscoveryNode("foo", buildNewFakeTransportAddress(), Version.CURRENT));
} else if (randomBoolean()) {
shardActionFailure = new SendRequestTransportException(
new DiscoveryNode("foo", buildNewFakeTransportAddress(), Version.CURRENT), "internal:cluster/shard/failure",
new DiscoveryNode("foo", buildNewFakeTransportAddress(), Version.CURRENT), ShardStateAction.SHARD_FAILED_ACTION_NAME,
new TransportException("TransportService is closed stopped can't send request"));
} else if (randomBoolean()) {
shardActionFailure = new TransportException(
"transport stopped, action: " + ShardStateAction.SHARD_FAILED_ACTION_NAME);
} else {
shardActionFailure = new ShardStateAction.NoLongerPrimaryShardException(failedReplica.shardId(), "the king is dead");
}
Expand Down