Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-34694

OneClientServer does not reliably call connect_callback

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: ts_middleware
    • Labels:
    • Story Points:
      1
    • Sprint:
      TSSW Sprint - May 09 - May 23
    • Team:
      Telescope and Site
    • Urgent?:
      No

      Description

      OneClientServer in ts_tcpip will fail to call connect_callback under the following circumstances:

      • A client connects (connect_callback correctly called)
      • The client drops the connection. OneClientServer does not call connect_callback, as documented, because it doesn't monitor the client connection.
      • A client connects. Here is where the problem arises. The last time connect_callback was called the connection was live, and the code recorded that. Now it's alive again, so it thinks the state has not changed and has no need to call connect_callback.

      Two solutions that come to mind (which might go together):

      • Monitor the connection. This would be nice for users but introduces some delay (depending on the polling frequency).
      • Whenever a client tries to connect record the new connection state (like monitoring, but less frequent and still will not call the connection callback when a connection is lost).

      These two might work best together.

        Attachments

          Issue Links

            Activity

            Hide
            rowen Russell Owen added a comment - - edited

            I decided to implement both solutions:

            • Whenever a client attempts to connect OneClientServer checks the current status and reports "disconnected" if the last call to connect_callback was "connected"
            • Run a background polling loop to detect if the client drops a connection.

            Also it turns out that write-only servers do not need to monitor reader in order to notice that the client has dropped the connection. I updated the docs accordingly

            Pull request: https://github.com/lsst-ts/ts_tcpip/pull/12

            Show
            rowen Russell Owen added a comment - - edited I decided to implement both solutions: Whenever a client attempts to connect OneClientServer checks the current status and reports "disconnected" if the last call to connect_callback was "connected" Run a background polling loop to detect if the client drops a connection. Also it turns out that write-only servers do not need to monitor reader in order to notice that the client has dropped the connection. I updated the docs accordingly Pull request: https://github.com/lsst-ts/ts_tcpip/pull/12
            Hide
            wvreeven Wouter van Reeven added a comment -

            Reviewed on GitHub.

            Show
            wvreeven Wouter van Reeven added a comment - Reviewed on GitHub.
            Hide
            rowen Russell Owen added a comment -

            Tagged as v0.3.7

            Show
            rowen Russell Owen added a comment - Tagged as v0.3.7

              People

              Assignee:
              rowen Russell Owen
              Reporter:
              rowen Russell Owen
              Reviewers:
              Wouter van Reeven
              Watchers:
              Russell Owen, Wouter van Reeven
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Jenkins

                  No builds found.