Skip to content

Commit b456107

Browse files
committed
Fix bwc again
1 parent 9389abe commit b456107

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

server/src/main/java/org/elasticsearch/rest/action/cat/RestThreadPoolAction.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,9 @@ private Table buildTable(RestRequest req, ClusterStateResponse state, NodesInfoR
226226
}
227227

228228
table.addCell(entry.getKey());
229-
table.addCell(poolInfo == null ? null : ThreadPool.ThreadPoolType.bwcType(poolInfo.getName()));
229+
table.addCell(
230+
poolInfo == null ? null : ThreadPool.ThreadPoolType.bwcType(poolInfo.getName(), poolInfo.getThreadPoolType())
231+
);
230232
table.addCell(poolStats == null ? null : poolStats.active());
231233
table.addCell(poolStats == null ? null : poolStats.threads());
232234
table.addCell(poolStats == null ? null : poolStats.queue());

server/src/main/java/org/elasticsearch/threadpool/ThreadPool.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,15 +184,15 @@ public static ThreadPoolType fromType(String type) {
184184
return threadPoolType;
185185
}
186186

187-
public static ThreadPoolType bwcType(String threadPoolName) {
187+
public static ThreadPoolType bwcType(String threadPoolName, ThreadPoolType defaultType) {
188188
switch (threadPoolName) {
189189
case Names.WRITE:
190190
case Names.WRITE_COORDINATION:
191191
return FIXED;
192192
case Names.GENERIC:
193193
return SCALING;
194194
default:
195-
return THREAD_POOL_TYPES.get(threadPoolName);
195+
return defaultType;
196196
}
197197
}
198198
}
@@ -999,7 +999,7 @@ public void writeTo(StreamOutput out) throws IOException {
999999
if (out.getTransportVersion().onOrAfter(TransportVersions.VIRTUAL_THREADS)) {
10001000
out.writeString(type.getType());
10011001
} else {
1002-
out.writeString(ThreadPoolType.bwcType(name).getType());
1002+
out.writeString(ThreadPoolType.bwcType(name, type).getType());
10031003
}
10041004
out.writeInt(min);
10051005
out.writeInt(max);

0 commit comments

Comments
 (0)