mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Add more _selector.close()
Also add more log.
This commit is contained in:
parent
b8e15a833b
commit
345d747913
@ -401,6 +401,7 @@ public class Agent implements HandlerFactory, IAgentControl {
|
||||
_connection.start();
|
||||
_shell.getBackoffAlgorithm().waitBeforeRetry();
|
||||
} while (!_connection.isStartup());
|
||||
s_logger.info("Connected to the server");
|
||||
}
|
||||
|
||||
public void processStartupAnswer(Answer answer, Response response, Link link) {
|
||||
|
||||
@ -78,6 +78,7 @@ public class NioClient extends NioConnection {
|
||||
Link.doHandshake(sch, sslEngine, true);
|
||||
s_logger.info("SSL: Handshake done");
|
||||
} catch (Exception e) {
|
||||
_selector.close();
|
||||
throw new IOException("SSL: Fail to init SSL! " + e);
|
||||
}
|
||||
|
||||
|
||||
@ -82,9 +82,7 @@ public abstract class NioConnection implements Runnable {
|
||||
try {
|
||||
_thread.wait();
|
||||
} catch (InterruptedException e) {
|
||||
if (s_logger.isTraceEnabled()) {
|
||||
s_logger.info("Interrupted start thread ", e);
|
||||
}
|
||||
s_logger.warn("Interrupted start thread ", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -116,6 +114,9 @@ public abstract class NioConnection implements Runnable {
|
||||
} catch (IOException e) {
|
||||
s_logger.error("Unable to initialize the threads.", e);
|
||||
return;
|
||||
} catch (Exception e) {
|
||||
s_logger.error("Unable to initialize the threads due to unknown exception.", e);
|
||||
return;
|
||||
}
|
||||
_isStartup = true;
|
||||
_thread.notifyAll();
|
||||
@ -432,7 +433,7 @@ public abstract class NioConnection implements Runnable {
|
||||
|
||||
/* Release the resource used by the instance */
|
||||
public void cleanUp() throws IOException {
|
||||
if (_selector != null && _selector.isOpen()) {
|
||||
if (_selector != null) {
|
||||
_selector.close();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user