[GH-ISSUE #110] Catch SocketTimeoutExceptions on instable connection #108

Closed
opened 2026-02-25 20:30:55 +03:00 by kerem · 4 comments
Owner

Originally created by @maybeec on GitHub (Feb 4, 2016).
Original GitHub issue: https://github.com/aluxnimm/outlookcaldavsynchronizer/issues/110

I observed SocketTimeoutExceptions to be logged, if traveling by train with an instable internet connection. I think this exception should be catched and not shown as an error.

<?xml version="1.0" encoding="utf-16"?>
<SynchronizationReport xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <ProfileName>CalDAV</ProfileName>
  <ProfileId>4664dc15-b502-4591-9c6c-ce98ca8d7dca</ProfileId>
  <StartTime>2016-02-03T15:41:49.6163813Z</StartTime>
  <InitialEntityMatchingPerformed>false</InitialEntityMatchingPerformed>
  <LoadErrors />
  <EntitySynchronizationReports />
  <ExceptionThatLeadToAbortion>System.Net.Http.HttpRequestException: An error occurred while sending the request. ---&gt; System.Net.WebException: Unable to connect to the remote server ---&gt; System.Net.Sockets.SocketException: An established connection was aborted by the software in your host machine XXXXXXXXXX
   at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
   at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket&amp; socket, IPAddress&amp; address, ConnectSocketState state, IAsyncResult asyncResult, Exception&amp; exception)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult, TransportContext&amp; context)
   at System.Net.Http.HttpClientHandler.GetRequestStreamCallback(IAsyncResult ar)
   --- End of inner exception stack trace ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at CalDavSynchronizer.DataAccess.HttpClientBasedClient.WebDavClient.&lt;ExecuteWebDavRequest&gt;d__a.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at CalDavSynchronizer.DataAccess.HttpClientBasedClient.WebDavClient.&lt;ExecuteWebDavRequestAndReadResponse&gt;d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at CalDavSynchronizer.DataAccess.CalDavDataAccess.&lt;GetEntities&gt;d__24.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at GenSync.Synchronization.Synchronizer`6.&lt;SynchronizeNoThrow&gt;d__4.MoveNext()</ExceptionThatLeadToAbortion>
  <Duration>00:00:06.1123496</Duration>
</SynchronizationReport>
Originally created by @maybeec on GitHub (Feb 4, 2016). Original GitHub issue: https://github.com/aluxnimm/outlookcaldavsynchronizer/issues/110 I observed SocketTimeoutExceptions to be logged, if traveling by train with an instable internet connection. I think this exception should be catched and not shown as an error. ``` xml <?xml version="1.0" encoding="utf-16"?> <SynchronizationReport xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <ProfileName>CalDAV</ProfileName> <ProfileId>4664dc15-b502-4591-9c6c-ce98ca8d7dca</ProfileId> <StartTime>2016-02-03T15:41:49.6163813Z</StartTime> <InitialEntityMatchingPerformed>false</InitialEntityMatchingPerformed> <LoadErrors /> <EntitySynchronizationReports /> <ExceptionThatLeadToAbortion>System.Net.Http.HttpRequestException: An error occurred while sending the request. ---&gt; System.Net.WebException: Unable to connect to the remote server ---&gt; System.Net.Sockets.SocketException: An established connection was aborted by the software in your host machine XXXXXXXXXX at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket&amp; socket, IPAddress&amp; address, ConnectSocketState state, IAsyncResult asyncResult, Exception&amp; exception) --- End of inner exception stack trace --- at System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult, TransportContext&amp; context) at System.Net.Http.HttpClientHandler.GetRequestStreamCallback(IAsyncResult ar) --- End of inner exception stack trace --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) at CalDavSynchronizer.DataAccess.HttpClientBasedClient.WebDavClient.&lt;ExecuteWebDavRequest&gt;d__a.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at CalDavSynchronizer.DataAccess.HttpClientBasedClient.WebDavClient.&lt;ExecuteWebDavRequestAndReadResponse&gt;d__0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at CalDavSynchronizer.DataAccess.CalDavDataAccess.&lt;GetEntities&gt;d__24.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) at GenSync.Synchronization.Synchronizer`6.&lt;SynchronizeNoThrow&gt;d__4.MoveNext()</ExceptionThatLeadToAbortion> <Duration>00:00:06.1123496</Duration> </SynchronizationReport> ```
kerem closed this issue 2026-02-25 20:30:55 +03:00
Author
Owner

@aluxnimm commented on GitHub (Feb 5, 2016):

again hard to distinguish between unstable connection or server problem.

<!-- gh-comment-id:180470584 --> @aluxnimm commented on GitHub (Feb 5, 2016): again hard to distinguish between unstable connection or server problem.
Author
Owner

@maybeec commented on GitHub (Feb 10, 2016):

ok, I just thought some time about it, but did not come to a good solution either.

<!-- gh-comment-id:182211015 --> @maybeec commented on GitHub (Feb 10, 2016): ok, I just thought some time about it, but did not come to a good solution either.
Author
Owner

@aluxnimm commented on GitHub (Feb 10, 2016):

one possibility would be a configurable mapping of exceptions and warning levels. needs some nice gui and coding though and no priority right now.

<!-- gh-comment-id:182213691 --> @aluxnimm commented on GitHub (Feb 10, 2016): one possibility would be a configurable mapping of exceptions and warning levels. needs some nice gui and coding though and no priority right now.
Author
Owner

@maybeec commented on GitHub (Feb 10, 2016):

yes, but this may result im maintenance hell to make everything configurable.
I am fine with that. This issue is not thrown very often. It just occurrs when the system is currently synchronizing while the connection breaks down.

<!-- gh-comment-id:182218863 --> @maybeec commented on GitHub (Feb 10, 2016): yes, but this may result im maintenance hell to make everything configurable. I am fine with that. This issue is not thrown very often. It just occurrs when the system is currently synchronizing while the connection breaks down.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/outlookcaldavsynchronizer#108
No description provided.