TEMPORARY: run the PostgreSQL suite three times on one server, push only (refs #98)
Two clean runs did not show the restart. This collects the server log of a failure sooner and lists Docker's events for the service container (oom, kill, die). Reverted before the merge. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0a9a8a38ec
commit
72f4cbe0a5
2 files changed
+26
-2
No files matched your search
@@ -83,6 +83,24 @@ internal static class ServiceLog
|
||||
Console.WriteLine($"Memoria ora: {Mib(memory?["usage"])}, limite visto dal contenitore {Mib(memory?["limit"])}, massimo {Mib(memory?["max_usage"])}");
|
||||
}
|
||||
|
||||
// Out-of-memory kills and signals as Docker saw them, from the container's start until now.
|
||||
var since = DateTimeOffset.Parse(state?["StartedAt"]?.GetValue<string>() ?? "", CultureInfo.InvariantCulture).ToUnixTimeSeconds();
|
||||
var until = DateTimeOffset.UtcNow.ToUnixTimeSeconds();
|
||||
var events = Uri.EscapeDataString($$"""{"container":["{{id}}"]}""");
|
||||
using (var answer = http.GetAsync(new Uri($"events?since={since}&until={until}&filters={events}", UriKind.Relative)).GetAwaiter().GetResult())
|
||||
{
|
||||
answer.EnsureSuccessStatusCode();
|
||||
var lines = answer.Content.ReadAsStringAsync().GetAwaiter().GetResult()
|
||||
.Split('\n', StringSplitOptions.RemoveEmptyEntries)
|
||||
.Select(line => JsonNode.Parse(line))
|
||||
.Where(e => e?["Action"]?.GetValue<string>() is not { } action
|
||||
|| !(action.StartsWith("exec_", StringComparison.Ordinal) || action == "health_status: healthy"))
|
||||
.Select(e => $" {DateTimeOffset.FromUnixTimeSeconds(e?["time"]?.GetValue<long>() ?? 0):O} {e?["Action"]}")
|
||||
.ToList();
|
||||
Console.WriteLine($"Eventi di Docker: {(lines.Count == 0 ? "nessuno" : "")}");
|
||||
lines.ForEach(Console.WriteLine);
|
||||
}
|
||||
|
||||
Console.WriteLine("-- registro");
|
||||
using var response = http.GetAsync(new Uri($"containers/{id}/logs?stdout=1&stderr=1×tamps=1", UriKind.Relative)).GetAwaiter().GetResult();
|
||||
response.EnsureSuccessStatusCode();
|
||||
|
||||
Reference in new issue
Block a user