selvaganesang commented on a change in pull request #1786: [TRAFODION-3260] 
SSMP may wait 3 seconds before handling requests
URL: https://github.com/apache/trafodion/pull/1786#discussion_r252539896
 
 

 ##########
 File path: core/sql/bin/ex_ssmp_main.cpp
 ##########
 @@ -246,8 +247,12 @@ void runServer(Int32 argc, char **argv)
     }
   }
 */
-    // wait for system messages only until ssmp starts receiving msgs.
-    cc->wait(300);
+    // Wait for messages, but we need ssmp to wake up periodically to
+    // perform garbage collection.
+    short mask = XWAIT(LREQ | LDONE, ssmpGlobals->getStatsMergeTimeout());
+    if (mask & LREQ) {
+      cc->wait(0);
 
 Review comment:
   This change looks good except that it is not encapsulated.  XWAIT, LREQ and 
LDONE concepts should have been part of the IPC infrastructure and not expected 
to be used in the callers of IPC infrastructure.  So, @narendragoyal and I 
tried the following  and it seems to achieve the same effect. 
   
   Add the following 2 lines in lieu of this code
   if (cc->getConnection() == NULL)
      cc->wait(ssmpGlobals->getStatsMergeTimeout());
   
   And undo the change at ssmpGlobals::work().
   
   Prior to Trafodion there used to be at least one opener to ssmp always. 
Hence this issue was not observed earlier.  It is good catch
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to