mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-26 14:54:56 +00:00
Remove BWC layer for rejected execution exception
The serialization changes for rejected execution exceptions has been backported to 6.x with the intention to appear in all versions since 6.3.0. Therefore, this BWC layer is no longer needed in master since master would never speak to a node that does not speak the same serialization.
This commit is contained in:
parent
6bf742dd1b
commit
1f1a4d17b4
@ -748,13 +748,6 @@ public abstract class StreamInput extends InputStream {
|
||||
switch (key) {
|
||||
case 0:
|
||||
final int ord = readVInt();
|
||||
// TODO: remove the if branch when master is bumped to 8.0.0
|
||||
assert Version.CURRENT.major < 8;
|
||||
if (ord == 59) {
|
||||
final ElasticsearchException ex = new ElasticsearchException(this);
|
||||
final boolean isExecutorShutdown = readBoolean();
|
||||
return (T) new EsRejectedExecutionException(ex.getMessage(), isExecutorShutdown);
|
||||
}
|
||||
return (T) ElasticsearchException.readException(this, ord);
|
||||
case 1:
|
||||
String msg1 = readOptionalString();
|
||||
|
@ -854,25 +854,9 @@ public abstract class StreamOutput extends OutputStream {
|
||||
} else if (throwable instanceof IOException) {
|
||||
writeVInt(17);
|
||||
} else if (throwable instanceof EsRejectedExecutionException) {
|
||||
// TODO: remove the if branch when master is bumped to 8.0.0
|
||||
assert Version.CURRENT.major < 8;
|
||||
if (version.before(Version.V_7_0_0_alpha1)) {
|
||||
/*
|
||||
* This is a backwards compatibility layer when speaking to nodes that still treated EsRejectedExceutionException as an
|
||||
* instance of ElasticsearchException. As such, we serialize this in a way that the receiving node would read this as an
|
||||
* EsRejectedExecutionException.
|
||||
*/
|
||||
final ElasticsearchException ex = new ElasticsearchException(throwable.getMessage());
|
||||
writeVInt(0);
|
||||
writeVInt(59);
|
||||
ex.writeTo(this);
|
||||
writeBoolean(((EsRejectedExecutionException) throwable).isExecutorShutdown());
|
||||
return;
|
||||
} else {
|
||||
writeVInt(18);
|
||||
writeBoolean(((EsRejectedExecutionException) throwable).isExecutorShutdown());
|
||||
writeCause = false;
|
||||
}
|
||||
} else {
|
||||
final ElasticsearchException ex;
|
||||
if (throwable instanceof ElasticsearchException && ElasticsearchException.isRegistered(throwable.getClass(), version)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user