Merge branch 'review2-p1-fix-space' into claude/owner-review-2-p1

This commit is contained in:
Alby96 committed 2026-10-26 23:40:38 +01:00
commit 509760832e
5 files changed
+50 -7

No files matched your search

+3 -3
View File
@@ -1066,9 +1066,9 @@ more than 64 MiB apart), a second line *Write volume* shows its free space. The
tooltip names the volume and its file system (on Linux the mount's type from
`/proc/self/mountinfo`, so an Unraid share reads `fuse.shfs`); on such a share without a
space path it says the figures are the share's primary storage and to map the share's array
view (`/mnt/user0/<share>`) to `/space`. The server's diagnostics report lists the archive,
the space path and `/data`, each with free space, file system and mount (amended
2026-10-26, R2).
view (`/mnt/user0/<share>`) to `/space` and set `CHRONOS_SPACE_PATH=/space`. The server's
diagnostics report lists the archive, the space path and `/data`, each with free space,
file system and mount (amended 2026-10-26, R2).
### 14.9 Configuration and Docker
+1 -1
View File
@@ -107,7 +107,7 @@
<data name="Admin.Dashboard.SpaceVolume.Tip" xml:space="preserve"><value>Space of the folder set in CHRONOS_SPACE_PATH, shown instead of the archive's own volume</value></data>
<data name="Admin.Dashboard.Storage" xml:space="preserve"><value>Storage</value></data>
<data name="Admin.Dashboard.Storage.Tip" xml:space="preserve"><value>Space of the volume that holds the archive</value></data>
<data name="Admin.Dashboard.UnraidShare.Tip" xml:space="preserve"><value>An Unraid share: these figures are its primary storage, often the cache, not the array the mover fills. Map the share's array view (/mnt/user0/&lt;share&gt;) to /space to see the array.</value></data>
<data name="Admin.Dashboard.UnraidShare.Tip" xml:space="preserve"><value>An Unraid share: these figures are its primary storage, often the cache, not the array the mover fills. Map its array view (/mnt/user0/&lt;share&gt;) to /space and set CHRONOS_SPACE_PATH=/space.</value></data>
<data name="Admin.Dashboard.UploadTotals" xml:space="preserve"><value>frames per day · {0} total · peak {1}</value><comment>long</comment></data>
<data name="Admin.Dashboard.Uploads" xml:space="preserve"><value>Uploads · last 30 days</value></data>
<data name="Admin.Dashboard.WithoutProxies.one" xml:space="preserve"><value>{0} sequence without proxies</value><comment>long</comment></data>
+1 -1
View File
@@ -107,7 +107,7 @@
<data name="Admin.Dashboard.SpaceVolume.Tip" xml:space="preserve"><value>Spazio della cartella indicata in CHRONOS_SPACE_PATH, mostrato al posto del volume dell'archivio</value></data>
<data name="Admin.Dashboard.Storage" xml:space="preserve"><value>Spazio</value></data>
<data name="Admin.Dashboard.Storage.Tip" xml:space="preserve"><value>Spazio del volume che contiene l'archivio</value></data>
<data name="Admin.Dashboard.UnraidShare.Tip" xml:space="preserve"><value>Una condivisione Unraid: questi valori sono il suo storage primario, spesso la cache, non l'array che il mover riempie. Mappa la vista array della condivisione (/mnt/user0/&lt;condivisione&gt;) su /space per vedere l'array.</value></data>
<data name="Admin.Dashboard.UnraidShare.Tip" xml:space="preserve"><value>Una condivisione Unraid: questi valori sono il suo storage primario, spesso la cache, non l'array che il mover riempie. Mappa la sua vista array (/mnt/user0/&lt;condivisione&gt;) su /space e imposta CHRONOS_SPACE_PATH=/space.</value></data>
<data name="Admin.Dashboard.UploadTotals" xml:space="preserve"><value>foto al giorno · totale {0} · picco {1}</value></data>
<data name="Admin.Dashboard.Uploads" xml:space="preserve"><value>Caricamenti · ultimi 30 giorni</value></data>
<data name="Admin.Dashboard.WithoutProxies.one" xml:space="preserve"><value>{0} sequenza senza proxy</value></data>
@@ -12,7 +12,7 @@ namespace Chronos.Server.Tests.Jobs;
[Category("server")]
public sealed class RenderNodeTests(TestContext context)
{
private static readonly string HevcJob = JsonSerializer.Serialize(
internal static readonly string HevcJob = JsonSerializer.Serialize(
new RenderJobParameters("4K HEVC", """{"codec":"hevc","bitrate":60}""", "hevc", 3840, 2160, UseProxies: false, null), ProtocolJson.Default.RenderJobParameters);
[Test]
@@ -147,7 +147,7 @@ public sealed class RenderNodeTests(TestContext context)
new RenderJobParameters("H.264", """{"preset":{"isAuto":false,"manual":"4k-h264"}}""", "h264", width, height, UseProxies: false, null),
ProtocolJson.Default.RenderJobParameters);
private static async Task<RenderNodeDto> RegisterAsync(HttpClient client, string name, string codec, int maxWidth)
internal static async Task<RenderNodeDto> RegisterAsync(HttpClient client, string name, string codec, int maxWidth)
{
using var response = await client.PostAsJsonAsync("/api/v1/nodes/register",
new RegisterNodeRequest(name, [new NodeEncoder(codec, codec.ToUpperInvariant() + " encoder", true, false)], maxWidth, maxWidth), ProtocolJson.Default.RegisterNodeRequest);
@@ -6,6 +6,7 @@ using Microsoft.Extensions.Logging;
using Chronos.Protocol;
using Chronos.Server.Configuration;
using Chronos.Server.Storage;
using Chronos.Server.Tests.Jobs;
using Chronos.Testing;
namespace Chronos.Server.Tests.Storage;
@@ -251,6 +252,48 @@ public sealed class VolumeSpaceTests(TestContext context)
await room.ExpectAsync(HttpStatusCode.OK);
}
[Test]
public async Task AFullArchiveVolumeRefusesARenderNodeResultUntilThereIsRoom()
{
await using var server = await TestServer.StartAsync(context, o => o.ChunkSizeBytes = 64 * 1024, s =>
{
s.AddSingleton<FakeVolumeSpace>();
s.AddSingleton<VolumeSpace>(sp => sp.GetRequiredService<FakeVolumeSpace>());
});
var volumes = server.Services.GetRequiredService<FakeVolumeSpace>();
var (editor, _, _) = await server.UserAsync("alberto", "editor", renderNode: true);
var frame = await Uploads.UploadAsync(editor, Uploads.Photo(5000, 73), "IMG_0001.CR3");
var job = await JobApiTests.CreateAsync(editor, "render", frame.SequenceId, RenderNodeTests.HevcJob);
var node = await RenderNodeTests.RegisterAsync(editor, "studio-pc", "hevc", 8192);
using (var claim = await editor.PostAsync($"/api/v1/nodes/{node.Id}/claim", null)) await claim.ExpectAsync(HttpStatusCode.OK);
var output = Uploads.Photo(3000, 74);
var request = new RenderResultRequest("Roof - 4K HEVC.mp4", output.Length, Uploads.Sha(output), "4K HEVC", "hevc", 3840, 2160, 25, 120);
using var started = await editor.PostAsJsonAsync($"/api/v1/nodes/{node.Id}/jobs/{job.Id}/result", request, ProtocolJson.Default.RenderResultRequest);
await started.ExpectAsync(HttpStatusCode.Created);
var upload = Assert.NotNull((await started.ReadAsync(ProtocolJson.Default.StartUploadResponse)).UploadId);
using (var put = await Uploads.PutChunkAsync(editor, upload, 0, output)) await put.ExpectAsync(HttpStatusCode.OK);
// Refused before the commit starts: the upload keeps receiving with its chunks and the node keeps the job.
var complete = $"/api/v1/nodes/{node.Id}/jobs/{job.Id}/result/complete";
volumes.Set(server.Options.ArchivePath, new VolumeFigures(0, 500 * GB));
using (var full = await editor.PostAsync(complete, null))
await full.ExpectErrorAsync(HttpStatusCode.InsufficientStorage, "insufficient_storage");
Assert.Equal(Chronos.Data.Repositories.UploadState.Receiving, Assert.NotNull(await server.Database.Uploads.FindByJobAsync(job.Id)).State);
Assert.True(server.Services.GetRequiredService<UploadStore>().Exists(upload));
var waiting = await JobApiTests.GetAsync(editor, job.Id);
Assert.Equal(("running", node.Id.ToString()), (waiting.State, waiting.NodeId));
volumes.Set(server.Options.ArchivePath, null);
using (var room = await editor.PostAsync(complete, null))
{
await room.ExpectAsync(HttpStatusCode.OK);
Assert.Equal("studio-pc", (await room.ReadAsync(ProtocolJson.Default.RenderDto)).ProducedBy);
}
Assert.Equal("done", (await JobApiTests.GetAsync(editor, job.Id)).State);
Assert.Equal(Chronos.Data.Repositories.UploadState.Committed, Assert.NotNull(await server.Database.Uploads.FindByJobAsync(job.Id)).State);
}
[Test]
public void TheSpacePathComesFromTheFileOrTheEnvironment()
{