Michael Blow has posted comments on this change.

Change subject: [NO ISSUE][OTH] Log open file count on unexpected HttpServer 
close
......................................................................


Patch Set 3:

(1 comment)

https://asterix-gerrit.ics.uci.edu/#/c/2483/3/hyracks-fullstack/hyracks/hyracks-http/src/main/java/org/apache/hyracks/http/server/HttpServer.java
File 
hyracks-fullstack/hyracks/hyracks-http/src/main/java/org/apache/hyracks/http/server/HttpServer.java:

PS3, Line 257: try {
             :                     OperatingSystemMXBean os = 
ManagementFactory.getOperatingSystemMXBean();
             :                     String getOpenFileMethodName = 
"getOpenFileDescriptorCount";
             :                     Method getOpenFileDescriptorCount = 
os.getClass().getMethod(getOpenFileMethodName);
             :                     if (getOpenFileDescriptorCount == null) {
             :                         LOGGER.log(Level.WARN, "The OS Bean 
doesn't have {} method", getOpenFileMethodName);
             :                     } else {
             :                         Method getMaxFileDescriptorCount = 
os.getClass().getDeclaredMethod("getMaxFileDescriptorCount");
             :                         
getOpenFileDescriptorCount.setAccessible(true);
             :                         
getMaxFileDescriptorCount.setAccessible(true);
             :                         LOGGER.log(Level.WARN,
             :                                 "Number of open files by this 
process is {}. Max number of allowed open files is {} ",
             :                                 
getOpenFileDescriptorCount.invoke(os), getMaxFileDescriptorCount.invoke(os));
             :                     }
             :                 } catch (Throwable th) { // NOSONAR: diagnostic 
code shouldn't cause server failure
             :                     LOGGER.log(Level.WARN, "Failed getting the 
count of open files", th);
             :                 }
> refactor to a util (e.g. MXHelper). We could use it in other places.
as part of the refactor, do the reflection discovery & setup once


-- 
To view, visit https://asterix-gerrit.ics.uci.edu/2483
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ie43f3392268b3994839d1f98f4de9fe669c7be62
Gerrit-PatchSet: 3
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: abdullah alamoudi <[email protected]>
Gerrit-Reviewer: Anon. E. Moose #1000171
Gerrit-Reviewer: Ian Maxon <[email protected]>
Gerrit-Reviewer: Jenkins <[email protected]>
Gerrit-Reviewer: Michael Blow <[email protected]>
Gerrit-Reviewer: Murtadha Hubail <[email protected]>
Gerrit-Reviewer: Till Westmann <[email protected]>
Gerrit-HasComments: Yes

Reply via email to