Skip to content

Commit 25ecfaa

Browse files
committed
Ignore virtual ethernet devices that disappear (#51581)
When checking if a device is up, today we can run into virtual ethernet devices that disappear while we are in the middle of checking. This leads to "no such device". This commit addresses such devices by treating them as not being up, if they are virtual ethernet devices that disappeared while we were checking.
1 parent dcc0657 commit 25ecfaa

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

server/src/main/java/org/elasticsearch/common/network/NetworkUtils.java

+4
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,10 @@ private static boolean isUp(final NetworkInterface intf) throws IOException {
172172
try {
173173
return intf.isUp();
174174
} catch (final SocketException e) {
175+
// virtual ethernet devices come and go, we will treat such a device that disappeared as not being up
176+
if (intf.getName().startsWith("veth") && e.getMessage().equals("No such device (getFlags() failed)")) {
177+
return false;
178+
}
175179
throw new IOException("failed to check if interface [" + intf.getName() + "] is up", e);
176180
}
177181
}

0 commit comments

Comments
 (0)