aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar vnugent <public@vaughnnugent.com>2023-03-11 18:17:59 -0500
committerLibravatar vnugent <public@vaughnnugent.com>2023-03-11 18:17:59 -0500
commitbb12d7fdb960f7c5fefbf520050b1827b82068f0 (patch)
tree25547e93d1ae879a45d384f4fec5c8543766b75f
parentdb4584c37380f1826986b3acfe35bbf92693dfc6 (diff)
Patch cache server FBMClient default timeout, extened timeout paremters to public api
-rw-r--r--plugins/ObjectCacheServer/src/ObjectCacheServerEntry.cs9
1 files changed, 5 insertions, 4 deletions
diff --git a/plugins/ObjectCacheServer/src/ObjectCacheServerEntry.cs b/plugins/ObjectCacheServer/src/ObjectCacheServerEntry.cs
index 0171064..5a748ef 100644
--- a/plugins/ObjectCacheServer/src/ObjectCacheServerEntry.cs
+++ b/plugins/ObjectCacheServer/src/ObjectCacheServerEntry.cs
@@ -138,10 +138,8 @@ namespace VNLib.Data.Caching.ObjectCache.Server
//Setup cluster worker
{
- TimeSpan timeout = TimeSpan.FromSeconds(10);
-
//Get pre-configured fbm client config for caching
- ClientConfig = FBMDataCacheExtensions.GetDefaultConfig(CacheHeap, endpoint.CacheConfig.MaxMessageSize / 2, timeout, this.IsDebug() ? Log : null);
+ ClientConfig = FBMDataCacheExtensions.GetDefaultConfig(CacheHeap, endpoint.CacheConfig.MaxMessageSize / 2, default, this.IsDebug() ? Log : null);
//Start Client runner
_ = this.ObserveWork(() => RunClientAsync(store, brokerAddress), 300);
@@ -449,6 +447,9 @@ namespace VNLib.Data.Caching.ObjectCache.Server
private async Task RunSyncTaskAsync(ActiveServer server, ICacheStore cacheStore, string nodeId)
{
+ //Setup timeout for get operations to avoid deadlocks
+ TimeSpan getTimeout = TimeSpan.FromSeconds(30);
+
//Setup client
FBMClient client = new(ClientConfig);
try
@@ -465,7 +466,7 @@ namespace VNLib.Data.Caching.ObjectCache.Server
modRequest.WriteHeader(ObjectId, string.IsNullOrWhiteSpace(newId) ? objectId : newId);
//Make request
- using FBMResponse response = await client.SendAsync(modRequest, UnloadToken);
+ using FBMResponse response = await client.SendAsync(modRequest, getTimeout, UnloadToken);
response.ThrowIfNotSet();