shwstppr commented on code in PR #10417:
URL: https://github.com/apache/cloudstack/pull/10417#discussion_r1987170408
##########
server/src/main/java/com/cloud/server/StatsCollector.java:
##########
@@ -834,11 +834,11 @@ private void
retrieveSession(ManagementServerHostStatsEntry newEntry) {
}
private void getDataBaseStatistics(ManagementServerHostStatsEntry
newEntry, long msid) {
- newEntry.setLastAgents(_agentMgr.getLastAgents());
+ List<String> lastAgents = _hostDao.listByLastMs(msid);
+ newEntry.setLastAgents(lastAgents);
List<String> agents = _hostDao.listByMs(msid);
newEntry.setAgents(agents);
- int count = _hostDao.countByMs(msid);
- newEntry.setAgentCount(count);
+ newEntry.setAgentCount(agents.size());
Review Comment:
Why not use countByMs here and at other places?
##########
utils/src/main/java/com/cloud/utils/nio/NioConnection.java:
##########
@@ -127,17 +129,31 @@ public void start() throws NioConnectionException {
_isStartup = true;
if (_executor.isShutdown()) {
- _executor = new ThreadPoolExecutor(_workers, 5 * _workers, 1,
TimeUnit.DAYS, new LinkedBlockingQueue<>(), new NamedThreadFactory(_name +
"-Handler"));
+ _executor = new ThreadPoolExecutor(_workers, 5 * _workers, 1,
TimeUnit.DAYS,
+ new LinkedBlockingQueue<>(5 * _workers), new
NamedThreadFactory(_name + "-Handler"),
+ new ThreadPoolExecutor.AbortPolicy());
+ }
+ if (_sslHandshakeExecutor.isShutdown()) {
+ String sslHandshakeHandlerName = _name + "-SSLHandshakeHandler";
+ if (factoryMaxNewConnectionsCount > 0) {
+ _sslHandshakeExecutor = new ThreadPoolExecutor(0,
this.factoryMaxNewConnectionsCount, 30,
+ TimeUnit.MINUTES, new SynchronousQueue<>(), new
NamedThreadFactory(sslHandshakeHandlerName),
+ new ThreadPoolExecutor.AbortPolicy());
+ } else {
+ _sslHandshakeExecutor = Executors.newCachedThreadPool(new
NamedThreadFactory(sslHandshakeHandlerName));
+ }
Review Comment:
same code in the class constructor, can be refactored
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]