Skip to content

Fix broad exception handling and resource cleanup - #242

Merged
enteriaza merged 4 commits into
masterfrom
catch-of-all-exceptions
Oct 22, 2026
Merged

enteriaza merged 4 commits into
masterfrom
catch-of-all-exceptions

Conversation

@enteriaza

Copy link
Copy Markdown
Collaborator

Summary

Remediate CodeQL cs/catch-of-all-exceptions findings across VectorNNTPD by replacing generic catch clauses with fatal-aware exception filters and moving resource cleanup into finally blocks where appropriate.

The changes preserve intended operational error handling while ensuring fatal exceptions propagate and resource cleanup is not skipped when exception filters reject an exception.

Changes

  • Replace generic catch clauses with ExceptionHelpers.IsFatal filters at intentional exception-containment boundaries.
  • Move ownership cleanup into finally blocks where cleanup must run regardless of exception type.
  • Preserve cancellation, retry, logging, and failure-propagation semantics.
  • Maintain Article Work settlement and delivery-limit behaviour.
  • Improve cleanup safety across ACME file locking, atomic file operations, network transports, TLS, RabbitMQ, and database connection factories.
  • Extend ACME lock regression tests to cover IOException, InvalidOperationException, and UnauthorizedAccessException.
  • Add ExceptionHelpers tests covering fatal versus operational exceptions.
  • Preserve the existing Path.Join remediation.

Validation

  • Release solution build: passed.
  • Common.Tests: 1,164 passed.
  • BackFillerService.Tests: 1,400 passed.
  • dotnet format --verify-no-changes: passed.
  • Local CodeQL analysis: zero cs/catch-of-all-exceptions findings.
  • Source audit: no remaining Path.Combine calls under src/.

Notes

The original GitHub Security baseline contained 66 open cs/catch-of-all-exceptions alerts. Local SARIF reports zero findings after remediation. Remote GitHub Security results and CI have not yet been revalidated against the final changes.

@enteriaza enteriaza self-assigned this Oct 22, 2026
@enteriaza enteriaza added the enhancement New feature or request label Oct 22, 2026
@enteriaza
enteriaza merged commit 4970dd5 into master Oct 22, 2026
7 checks passed
@enteriaza
enteriaza deleted the catch-of-all-exceptions branch October 22, 2026 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants