aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar vnugent <public@vaughnnugent.com>2024-04-20 12:01:08 -0400
committerLibravatar vnugent <public@vaughnnugent.com>2024-04-20 12:01:08 -0400
commitda872f10e7f7578dd5bb28e10cb73c4b8ebbcc07 (patch)
tree442810f5f6b848b84a321677746d6368d5a8567b
parent81bda557a5053be9e722ee9e5c43e45f548f2b45 (diff)
chore: Package update & add http error handler
-rw-r--r--plugins/VNLib.Data.Caching.Providers.Redis/src/VNLib.Data.Caching.Providers.Redis.csproj2
-rw-r--r--plugins/VNLib.Data.Caching.Providers.VNCache/src/FBMCacheClient.cs18
2 files changed, 11 insertions, 9 deletions
diff --git a/plugins/VNLib.Data.Caching.Providers.Redis/src/VNLib.Data.Caching.Providers.Redis.csproj b/plugins/VNLib.Data.Caching.Providers.Redis/src/VNLib.Data.Caching.Providers.Redis.csproj
index ac5fb63..a896cf8 100644
--- a/plugins/VNLib.Data.Caching.Providers.Redis/src/VNLib.Data.Caching.Providers.Redis.csproj
+++ b/plugins/VNLib.Data.Caching.Providers.Redis/src/VNLib.Data.Caching.Providers.Redis.csproj
@@ -39,7 +39,7 @@
</ItemGroup>
<ItemGroup>
- <PackageReference Include="StackExchange.Redis" Version="2.7.27" />
+ <PackageReference Include="StackExchange.Redis" Version="2.7.33" />
</ItemGroup>
<ItemGroup>
diff --git a/plugins/VNLib.Data.Caching.Providers.VNCache/src/FBMCacheClient.cs b/plugins/VNLib.Data.Caching.Providers.VNCache/src/FBMCacheClient.cs
index e84a077..28ccdcd 100644
--- a/plugins/VNLib.Data.Caching.Providers.VNCache/src/FBMCacheClient.cs
+++ b/plugins/VNLib.Data.Caching.Providers.VNCache/src/FBMCacheClient.cs
@@ -23,6 +23,7 @@
*/
using System;
+using System.IO;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
@@ -255,21 +256,22 @@ namespace VNLib.Data.Caching.Providers.VNCache
pluginLog.Verbose("Stack trace: {re}", wse);
}
//SEs may be raised when the server is not available
- catch (HttpRequestException he) when (he.InnerException is SocketException)
+ catch (HttpRequestException he) when (he.InnerException is SocketException se)
{
pluginLog.Debug("Failed to connect to random cache server because a TCP connection could not be established");
- pluginLog.Verbose("Stack trace: {re}", he.InnerException);
+ pluginLog.Verbose("Stack trace: {re}", se);
+ await Task.Delay(1000, exitToken);
}
- catch (HttpRequestException he) when (he.StatusCode.HasValue)
+ catch (HttpRequestException he) when (he.InnerException is IOException ioe && ioe.InnerException is SocketException se)
{
- pluginLog.Warn("Failed to negotiate with cache server {reason}", he.Message);
- pluginLog.Verbose("Stack trace: {re}", he);
+ pluginLog.Debug("Failed to connect to random cache server because a TCP connection could not be established");
+ pluginLog.Verbose("Stack trace: {re}", se);
await Task.Delay(1000, exitToken);
}
- catch(HttpRequestException hre) when (hre.InnerException is SocketException se)
+ catch (HttpRequestException he) when (he.StatusCode.HasValue)
{
- pluginLog.Warn("Failed to establish a TCP connection to server {server} {reason}", node.NodeId, se.Message);
- pluginLog.Verbose("Stack trace: {re}", se);
+ pluginLog.Warn("Failed to negotiate with cache server {reason}", he.Message);
+ pluginLog.Verbose("Stack trace: {re}", he);
await Task.Delay(1000, exitToken);
}
finally