Skip to content

Commit

Permalink
Unpack value before reading
Browse files Browse the repository at this point in the history
  • Loading branch information
georgew5656 committed Jan 5, 2024
1 parent 32da136 commit 185978d
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -499,12 +499,15 @@ private static int getTCPAcceptQueueSize()
{
try {
BufferedReader in = Files.newBufferedReader(Paths.get("/proc/sys/net/core/somaxconn"));
return Integer.parseInt(in.readLine().trim());
String acceptQueueSize = in.readLine();
if (acceptQueueSize != null) {
return Integer.parseInt(acceptQueueSize);
}
}
catch (Exception e) {
log.warn("Unable to read /proc/sys/net/core/somaxconn, falling back to default value for TCP accept queue size");
return 128; // Default value of net.core.somaxconn on Linux
}
return 128; // Default value of net.core.somaxconn on Linux
}

@Provides
Expand Down

0 comments on commit 185978d

Please sign in to comment.