Bladeren bron

HPCC-16666 Add more tracing info for HPCC-15043 mplink closed

Signed-off-by: Mark Kelly <mark.kelly@lexisnexis.com>
Mark Kelly 8 jaren geleden
bovenliggende
commit
7d2e0080cf
3 gewijzigde bestanden met toevoegingen van 16 en 4 verwijderingen
  1. 8 0
      system/jlib/jsocket.cpp
  2. 3 1
      system/jlib/jsocket.hpp
  3. 5 3
      system/mp/mpcomm.cpp

+ 8 - 0
system/jlib/jsocket.cpp

@@ -4706,7 +4706,15 @@ public:
                                     }
                                     if (ep_mode != 0) {
                                         tonotify.append(*epsi);
+#ifdef _TRACELINKCLOSED
+                                        // temporary, to help diagnose spurios socket closes (hpcc-15043)
+                                        // currently no implementation of notifySelected() uses the mode
+                                        // argument so we can pass in the epoll events mask and log that
+                                        // if there is no data and the socket gets closed
+                                        tonotify.element(tonotify.length()-1).mode = epevents[j].events;
+#else
                                         tonotify.element(tonotify.length()-1).mode = ep_mode;
+#endif
                                     }
                                 }
                             }

+ 3 - 1
system/jlib/jsocket.hpp

@@ -30,7 +30,9 @@
 #include "jexcept.hpp"
 #include "jthread.hpp"
 
-
+#if 1 // spurious mplink closed tracing info
+# define _TRACELINKCLOSED
+#endif
 
 #define DEFAULT_LISTEN_QUEUE_SIZE    200            // maximum for windows 2000 server
 #define DEFAULT_LINGER_TIME          1000 // seconds

+ 5 - 3
system/mp/mpcomm.cpp

@@ -49,9 +49,6 @@
 //#define _TRACE
 //#define _FULLTRACE
 
-#if 1 // #ifdef _FULLTRACE
-#define _TRACELINKCLOSED
-#endif
 #define _TRACEMPSERVERNOTIFYCLOSED
 #define _TRACEORPHANS
 
@@ -1472,7 +1469,12 @@ public:
                     }
                 }
                 if (pc) 
+                {
+#ifdef _TRACELINKCLOSED
+                    LOG(MCdebugInfo(100), unknownJob, "CMPPacketReader::notifySelected() about to close socket, mode = 0x%x", selected);
+#endif
                     pc->closeSocket(false, true);
+                }
                 return false;
             }
             do {