How do I avoid first ssh client hanging when using shared ssh connections












0















Theres plenty of examples on the web of how to use connection sharing:



ControlMaster auto
ControlPath ~/.ssh/sockets/%r@%h-%p
ControlPersist 600


However, I've found that the very first ssh connection (this is using git if that is relevant) hangs at an odd place (during exit I believe) - any attempt to pstack the git process or even kill -9 it do nothing at all. All that works is to kill the calling process.



However, it appears the ssh connection socket has been set up (there is now an ssh process running which ps shows as ssh: /home/ttanner/.ssh/sockets/user@host-22 [mux]) and subsequent sshs appear to work fine.



This is quite annoying as git seems to spend quite some time fiddling with ssh connections and we'd really like to use this in our CI system - when we don't know on which machine we're going to running any particular bunch of git commands and so hanging on the 1st connection isn't a good option



Addendum: Running with debug on shows this odd message:



debug3: mux_client_read_packet: read header failed: Broken pipe


which possibly means that the sharing isn't actually working at all, it's just that in the subsequent connections git doesn't care and is using local information.










share|improve this question





























    0















    Theres plenty of examples on the web of how to use connection sharing:



    ControlMaster auto
    ControlPath ~/.ssh/sockets/%r@%h-%p
    ControlPersist 600


    However, I've found that the very first ssh connection (this is using git if that is relevant) hangs at an odd place (during exit I believe) - any attempt to pstack the git process or even kill -9 it do nothing at all. All that works is to kill the calling process.



    However, it appears the ssh connection socket has been set up (there is now an ssh process running which ps shows as ssh: /home/ttanner/.ssh/sockets/user@host-22 [mux]) and subsequent sshs appear to work fine.



    This is quite annoying as git seems to spend quite some time fiddling with ssh connections and we'd really like to use this in our CI system - when we don't know on which machine we're going to running any particular bunch of git commands and so hanging on the 1st connection isn't a good option



    Addendum: Running with debug on shows this odd message:



    debug3: mux_client_read_packet: read header failed: Broken pipe


    which possibly means that the sharing isn't actually working at all, it's just that in the subsequent connections git doesn't care and is using local information.










    share|improve this question



























      0












      0








      0








      Theres plenty of examples on the web of how to use connection sharing:



      ControlMaster auto
      ControlPath ~/.ssh/sockets/%r@%h-%p
      ControlPersist 600


      However, I've found that the very first ssh connection (this is using git if that is relevant) hangs at an odd place (during exit I believe) - any attempt to pstack the git process or even kill -9 it do nothing at all. All that works is to kill the calling process.



      However, it appears the ssh connection socket has been set up (there is now an ssh process running which ps shows as ssh: /home/ttanner/.ssh/sockets/user@host-22 [mux]) and subsequent sshs appear to work fine.



      This is quite annoying as git seems to spend quite some time fiddling with ssh connections and we'd really like to use this in our CI system - when we don't know on which machine we're going to running any particular bunch of git commands and so hanging on the 1st connection isn't a good option



      Addendum: Running with debug on shows this odd message:



      debug3: mux_client_read_packet: read header failed: Broken pipe


      which possibly means that the sharing isn't actually working at all, it's just that in the subsequent connections git doesn't care and is using local information.










      share|improve this question
















      Theres plenty of examples on the web of how to use connection sharing:



      ControlMaster auto
      ControlPath ~/.ssh/sockets/%r@%h-%p
      ControlPersist 600


      However, I've found that the very first ssh connection (this is using git if that is relevant) hangs at an odd place (during exit I believe) - any attempt to pstack the git process or even kill -9 it do nothing at all. All that works is to kill the calling process.



      However, it appears the ssh connection socket has been set up (there is now an ssh process running which ps shows as ssh: /home/ttanner/.ssh/sockets/user@host-22 [mux]) and subsequent sshs appear to work fine.



      This is quite annoying as git seems to spend quite some time fiddling with ssh connections and we'd really like to use this in our CI system - when we don't know on which machine we're going to running any particular bunch of git commands and so hanging on the 1st connection isn't a good option



      Addendum: Running with debug on shows this odd message:



      debug3: mux_client_read_packet: read header failed: Broken pipe


      which possibly means that the sharing isn't actually working at all, it's just that in the subsequent connections git doesn't care and is using local information.







      ssh git






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 21 '18 at 11:21







      Tom Tanner

















      asked Dec 21 '18 at 10:34









      Tom TannerTom Tanner

      1014




      1014






















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "3"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1386607%2fhow-do-i-avoid-first-ssh-client-hanging-when-using-shared-ssh-connections%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Super User!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1386607%2fhow-do-i-avoid-first-ssh-client-hanging-when-using-shared-ssh-connections%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Список кардиналов, возведённых папой римским Каликстом III

          Deduzione

          Mysql.sock missing - “Can't connect to local MySQL server through socket”