Copilot commented on code in PR #6684:
URL: https://github.com/apache/ignite-3/pull/6684#discussion_r2398769062


##########
modules/platforms/dotnet/Apache.Extensions.Caching.Ignite.Tests/IgniteDistributedCacheTests.cs:
##########
@@ -30,6 +30,9 @@ public class IgniteDistributedCacheTests : IgniteTestsBase
 {
     private IgniteClientGroup _clientGroup = null!;
 
+    // Override the base client to avoid causality issues due to a separate 
client instance.
+    private new IIgnite Client => 
_clientGroup.GetIgniteAsync().AsTask().GetAwaiter().GetResult();
+
     [OneTimeSetUp]
     public void InitClientGroup() =>
         _clientGroup = new IgniteClientGroup(new 
IgniteClientGroupConfiguration { ClientConfiguration = GetConfig() });

Review Comment:
   Using `GetAwaiter().GetResult()` blocks the calling thread and can cause 
deadlocks in certain synchronization contexts. Consider making this an async 
property or caching the result to avoid repeated blocking calls.
   ```suggestion
       private IIgnite _client = null!;
   
       // Override the base client to avoid causality issues due to a separate 
client instance.
       private new IIgnite Client => _client;
   
       [OneTimeSetUp]
       public async Task InitClientGroup()
       {
           _clientGroup = new IgniteClientGroup(new 
IgniteClientGroupConfiguration { ClientConfiguration = GetConfig() });
           _client = await _clientGroup.GetIgniteAsync();
       }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to