@@ -1768,7 +1768,8 @@ private AgentAttache sendReadyAndGetAttache(HostVO host, ReadyCommand ready, Lin
17681768 GlobalLock joinLock = getHostJoinLock (host .getId ());
17691769 try {
17701770 long processStart = System .currentTimeMillis ();
1771- if (joinLock .lock (getTimeoutSec ())) {
1771+ int timeOutSec = getTimeoutSec ();
1772+ if (joinLock .lock (timeOutSec )) {
17721773 logProcessingStart (host , joinLock );
17731774 try {
17741775 updateReadyCommandWithMSList (host , ready , startup );
@@ -1778,7 +1779,7 @@ private AgentAttache sendReadyAndGetAttache(HostVO host, ReadyCommand ready, Lin
17781779 joinLock .unlock ();
17791780 }
17801781 } else {
1781- throw createLockAcquisitionException (host , joinLock , processStart );
1782+ throw createLockAcquisitionException (host , joinLock , timeOutSec , processStart );
17821783 }
17831784 } finally {
17841785 joinLock .releaseRef ();
@@ -1798,14 +1799,14 @@ private void logProcessingFinish(HostVO host, GlobalLock joinLock, long processS
17981799 StringBuilder msgBuilder = getSummaryMsgBuilder ("Processing Host connection finished" ,
17991800 EventTypes .EVENT_HOST_RECONNECT , host .getUuid (), host .getName (), joinLock .getName (), null , null ,
18001801 processFinish );
1801- logger .fatal (msgBuilder .toString ());
1802+ logger .info (msgBuilder .toString ());
18021803 }
18031804
18041805 private void updateReadyCommandWithMSList (HostVO host , ReadyCommand ready , StartupCommand [] startup ) {
18051806 List <String > agentMSHostList = new ArrayList <>();
18061807 String lbAlgorithm = null ;
18071808
1808- if (startup != null ) {
1809+ if (startup != null && startup . length > 0 ) {
18091810 String agentMSHosts = startup [0 ].getMsHostList ();
18101811 if (StringUtils .isNotEmpty (agentMSHosts )) {
18111812 String [] msHosts = agentMSHosts .split ("@" );
@@ -1828,19 +1829,19 @@ private void setReadyCommandMSList(HostVO host, ReadyCommand ready) {
18281829 ready .setAvoidMsHostList (avoidMsList );
18291830 ready .setLbAlgorithm (indirectAgentLB .getLBAlgorithmName ());
18301831 ready .setLbCheckInterval (indirectAgentLB .getLBPreferredHostCheckInterval (host .getClusterId ()));
1831- logger .debug ("Agent's management server host list is not up to date, sending list update:" + newMSList );
1832+ logger .debug ("Agent's management server host list is not up to date, sending list update:{}" , newMSList );
18321833 }
18331834
18341835 private AgentAttache createAndNotifyAttache (HostVO host , Link link , StartupCommand [] startup ) throws ConnectionException {
18351836 AgentAttache attache = createAttacheForConnect (host , link );
18361837 return notifyMonitorsOfConnection (attache , startup , false );
18371838 }
18381839
1839- private ConnectionException createLockAcquisitionException (HostVO host , GlobalLock joinLock , long processStart ) {
1840+ private ConnectionException createLockAcquisitionException (HostVO host , GlobalLock joinLock , int timeOutSec , long processStart ) {
18401841 long processFinish = System .currentTimeMillis () - processStart ;
18411842 String title = "Failed to connect Host" ;
1842- String summary = String .format ("Failure due to unable to acquire lock %s during %s seconds" ,
1843- joinLock .getName (), 60 );
1843+ String summary = String .format ("Failure due to unable to acquire lock %s during %d seconds" ,
1844+ joinLock .getName (), timeOutSec );
18441845
18451846 StringBuilder msgBuilder = getSummaryMsgBuilder (title , EventTypes .EVENT_HOST_RECONNECT , host .getUuid (),
18461847 host .getName (), joinLock .getName (), summary , null , processFinish );
@@ -2023,7 +2024,7 @@ protected void connectAgent(final Link link, final Command[] cmds, final Request
20232024 answers [i ] = answer ;
20242025 }
20252026 }
2026- Response response = new Response (request , answers [ 0 ] , _nodeId , -1 );
2027+ Response response = new Response (request , answers , _nodeId , -1 );
20272028 try {
20282029 link .send (response .toBytes ());
20292030 } catch (ClosedChannelException e ) {
0 commit comments