From bb12d7fdb960f7c5fefbf520050b1827b82068f0 Mon Sep 17 00:00:00 2001 From: vnugent Date: Sat, 11 Mar 2023 18:17:59 -0500 Subject: Patch cache server FBMClient default timeout, extened timeout paremters to public api --- plugins/ObjectCacheServer/src/ObjectCacheServerEntry.cs | 9 +++++---- 1 file 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(); -- cgit