Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System.Net.Http.HttpRequestException occured in ping-pong process #3

Closed
KonH opened this issue Sep 7, 2017 · 2 comments
Closed

System.Net.Http.HttpRequestException occured in ping-pong process #3

KonH opened this issue Sep 7, 2017 · 2 comments

Comments

@KonH
Copy link

KonH commented Sep 7, 2017

Hi! We faced to another issue with unhandled exception in ping-pong progress, and as I see we can't handle it on our side.

Steps to reproduce:

  • Start bot
  • Disable network connection
  • Wait several seconds

Details:
Exception is at SlackRtmDriver.cs:75:
await this.ReconnectRtmAsync(bus, logger); <== here

System.Net.Http.HttpRequestException occurred
HResult=0x80072EE7
Message=An error occurred while sending the request.
Source=
StackTrace:
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult() at System.Net.Http.HttpClient.<FinishSendAsync>d__58.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult()
at System.Net.Http.HttpClient.d__321.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult()
at SlackBotNet.Drivers.SlackRtmDriver.d__8.MoveNext() in C:\projects\other\slackbotnet\src\SlackBotNet\Drivers\SlackRtmDriver.cs:line 116
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at SlackBotNet.Drivers.SlackRtmDriver.<>c__DisplayClass6_0.<b__0>d.MoveNext() in C:\projects\other\slackbotnet\src\SlackBotNet\Drivers\SlackRtmDriver.cs:line 75

Inner Exception 1:
WinHttpException: Can not resolve server name or address

@KonH
Copy link
Author

KonH commented Sep 7, 2017

In my fork I have made hotfix, which is not acceptable for normal operation (bot can't read the messages after fail), but at least eliminates the unhandled exception. In our conditions it is suitable as a temporary solution.
For fix bot read ability In next commit I have tried to reconnect after websocket status is not Open. I'm not sure if this is the correct solution, I didn't have enough time to adequately study the project code.

jweber added a commit that referenced this issue Sep 7, 2017
@jweber
Copy link
Owner

jweber commented Sep 7, 2017

I put in some logic that will retry the reconnect attempts until a new socket connection can be established. My initial tests were just around the tcp connection being dropped and didn't account for a larger network disruption.

v0.8.7 has been released to NuGet with this change. Hopefully this will resolve your issue!

@KonH KonH closed this as completed Nov 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants