Copilot commented on code in PR #6868:
URL: https://github.com/apache/ignite-3/pull/6868#discussion_r2477759924
##########
modules/platforms/dotnet/Apache.Ignite.Tests/JavaServer.cs:
##########
@@ -107,6 +109,31 @@ public void Dispose()
Log(">>> Java server stopped.");
}
+ private static async Task<JavaServer> StartInternalAsyncWithRetry(
+ bool old, Dictionary<string, string?> env, int? defaultPort = null)
+ {
+ int attempt = 0;
+
+ while (true)
+ {
+ try
+ {
+ attempt++;
+ return await StartInternalAsync(old, env, defaultPort);
+ }
+ catch (Exception e)
+ {
+ if (attempt == MaxAttempts)
+ {
+ Log($">>> Java server start failed after {MaxAttempts}
attempts.");
+ throw;
+ }
+
+ Log($">>> Java server start attempt {attempt} failed: {e}.
Retrying...");
Review Comment:
The retry loop doesn't include any delay between attempts. Consider adding a
delay (e.g., `await Task.Delay(TimeSpan.FromSeconds(1))` after line 132) to
avoid immediately retrying after a failure, which could allow transient issues
to resolve.
```suggestion
Log($">>> Java server start attempt {attempt} failed:
{e}. Retrying...");
await Task.Delay(TimeSpan.FromSeconds(1));
```
##########
modules/platforms/dotnet/Apache.Ignite.Tests/JavaServer.cs:
##########
@@ -107,6 +109,31 @@ public void Dispose()
Log(">>> Java server stopped.");
}
+ private static async Task<JavaServer> StartInternalAsyncWithRetry(
+ bool old, Dictionary<string, string?> env, int? defaultPort = null)
+ {
+ int attempt = 0;
+
+ while (true)
+ {
+ try
+ {
+ attempt++;
+ return await StartInternalAsync(old, env, defaultPort);
+ }
+ catch (Exception e)
+ {
+ if (attempt == MaxAttempts)
+ {
+ Log($">>> Java server start failed after {MaxAttempts}
attempts.");
+ throw;
+ }
+
+ Log($">>> Java server start attempt {attempt} failed: {e}.
Retrying...");
Review Comment:
[nitpick] Logging the entire exception object `{e}` could produce very
verbose output. Consider logging `{e.Message}` instead to keep logs more
concise while still providing useful diagnostic information.
```suggestion
Log($">>> Java server start attempt {attempt} failed:
{e.Message}. Retrying...");
```
--
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]