Skip to content

Return error on canceled download#98

Merged
llugin merged 3 commits intomain-gbfrom
VTI-705-return-err-on-canceled-ctx
Oct 10, 2025
Merged

Return error on canceled download#98
llugin merged 3 commits intomain-gbfrom
VTI-705-return-err-on-canceled-ctx

Conversation

@llugin
Copy link

@llugin llugin commented Oct 9, 2025

What

Return error on canceled download context

Why

in such way we are always notified that context was cancelled when calling csaf_downloader through error channel, rather than silently stopping the download process.

References

VTI-705

in such way we are always notified that context was cancelled when calling csaf_downloader
@llugin llugin requested a review from a team as a code owner October 9, 2025 14:55
@github-actions
Copy link

github-actions bot commented Oct 9, 2025

Conventional Commits Report

😢 No conventional commits found.

👉 Learn more about the conventional commits usage at Greenbone.

@github-actions
Copy link

github-actions bot commented Oct 9, 2025

Modver result

This report was generated by Modver,
a Go package and command that helps you obey semantic versioning rules in your Go module.

This PR does not require a change in your module’s version number.
(You might still consider bumping the patchlevel anyway.)

@llugin llugin added the minor release Set label to create a minor release label Oct 10, 2025
@mgoetzegb
Copy link
Member

There is a second ctx.Done() in downloadFiles where we read in the links to the CSAF documents:

allFiles:
for _, file := range files {
select {
case advisoryCh <- file:
case <-ctx.Done():
break allFiles
}
}

I think it is the safest to also send the context error to the error channel as well.

In the end we can end up with many of those cancel errors in the error ultimately returned (one per worker + one in place mentioned above). But I think that is acceptable and better than possibly missing error feedback in edge cases.

mgoetzegb
mgoetzegb previously approved these changes Oct 10, 2025
@mgoetzegb mgoetzegb dismissed their stale review October 10, 2025 10:22

missed something

@llugin llugin added patch release Set label to create a patch release and removed minor release Set label to create a minor release labels Oct 10, 2025
@llugin llugin merged commit 308256e into main-gb Oct 10, 2025
5 of 6 checks passed
@llugin llugin deleted the VTI-705-return-err-on-canceled-ctx branch October 10, 2025 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch release Set label to create a patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants