Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/eight-places-see.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@milaboratories/pl-drivers": patch
---

Consistent driver cleanup avoids test flaps
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,8 @@ export class DownloadDriver implements BlobDriver, AsyncDisposable {
if (deleted) this.keyToOnDemand.delete(blobKey(blobId));
}

/** Removes all files from a hard drive. */
/** Stops all active downloads, drops all pending (queued) downloads and removes
* all partially downloaded files from storage. */
Comment on lines +638 to +639
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

This updated documentation is much clearer, but the implementation of releaseAll doesn't seem to fully match it. The function stops the queue but doesn't appear to abort active downloads or remove partially downloaded files.

To align with this comment and ensure a stricter teardown, releaseAll should probably iterate through this.keyToDownload, and for each task, call this.removeTask(). This would ensure tasks are aborted, triggering the cleanup of any partial files and releasing resources correctly.

async releaseAll() {
this.downloadQueue.stop();

Expand All @@ -646,6 +647,7 @@ export class DownloadDriver implements BlobDriver, AsyncDisposable {
}

async dispose(): Promise<void> {
await this.releaseAll();
await this.rangesCache.dispose();
}

Expand Down
2 changes: 1 addition & 1 deletion tests/workflow-tengo/src/exec/run/hello_go.tpl.tengo
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ self.body(func(inputs) {
/* Checks, that default limits are applied based
* on queue block developer choses when bulding the command */
run := exec.builder().
software(sw).
software(sw).
inLightQueue().
arg(inputs.text).
saveStdoutContent().
Expand Down
Loading