Skip to content
This repository was archived by the owner on Jan 5, 2026. It is now read-only.

Fix NamedPipe reconnection - #6526

Merged
tracyboehrer (tracyboehrer) merged 5 commits into
microsoft:mainfrom
woasishen:main
Oct 25, 2022
Merged

tracyboehrer (tracyboehrer) merged 5 commits into
microsoft:mainfrom
woasishen:main

Conversation

@woasishen

@woasishen fangyangci (woasishen) commented Oct 23, 2022 •

Copy link
Copy Markdown
Contributor

Fixes #6306

Description

NamedPipe Reconnection did not fix well by the previous PR for this issue(#6306), the disconnect issue(ib/ob false) still occur.
This pr add retry in NamedPipeTransport, and will fix NamedPipe ib/ob false issue, after customer update their SDK and I publish new version of DL-ASE.
This change is backward compatibility, verified in Testing.

Specific Changes

  1. Add a callback in NamedPipeTransport.ConnectAsync to correctly set the IsConnect property.
    Because NamedPipeTransport.ConnectAsync implemetations handle both connectAsync and processAsync, can't find out the correct time to set the IsConnected status outside.
  2. Add retry logic in NamedPipeTransport.ConnectAsync, to avoid connect exception. This does happen sometimes in Azure.
  3. Add random timeout in retry logic, to avoid dead lock when NamePipeServer and NamedPipeClient connect/reconnect.
    This does happen sometimes in Azure.
  4. Add a connection double check in NamedPipeTransport line 91, previous code missed lots of disconnection scenarios.

Testing

We have two program, bot and ase, they use namedPipeTransport as a pipe to comunicate.
This pr will update the SDK which is used by both bot and ase.
So I call the program before this change "old bot"/ "old ase".
And call the program after this change "new bot"/ "new ase".
There are more than one bugs in the NamedPipe connect/reconnect.
Some were fixed in BotBuild SDK4.17, and some were fixed in our ase version 1.1.0.0 which was published early this year. But still connection issue hanppends.
Below I verified all kinds of scenarios I can think of. Because some scenarios were hardly reproduce in Azure, so I verified them locally.
Here is my verified scenarios.
My conclusion is: after both bot and ase update their SDK, all issue will be fixed. And if customer just update one of them, won't bring in any harm to their service.
image

@woasishen
fangyangci (woasishen) requested a review from a team as a code owner October 23, 2022 17:47
Comment thread libraries/Microsoft.Bot.Connector.Streaming/Transport/NamedPipeTransport.cs Outdated
Comment thread libraries/Microsoft.Bot.Connector.Streaming/Transport/NamedPipeTransport.cs Outdated
Comment thread libraries/Microsoft.Bot.Connector.Streaming/Transport/NamedPipeTransport.cs Outdated
Comment thread libraries/Microsoft.Bot.Connector.Streaming/Transport/NamedPipeTransport.cs Outdated
Comment thread libraries/Microsoft.Bot.Connector.Streaming/Transport/WebSocketTransport.cs Outdated
@tracyboehrer

Copy link
Copy Markdown
Member

If the others are good with this, go ahead and merge. Scheduled to get a release out this week, and would like to get this in. Trying to cut an RC build today.

@tracyboehrer

Copy link
Copy Markdown
Member

Ping on this. Good to go or should it waiting until next release, which will be in December.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NamedPipe could not reconnect correctly when disconnected unexpectedly

6 participants