Skip to content

Conversation

@sedkis
Copy link
Contributor

@sedkis sedkis commented Oct 29, 2024

Description

Changed the implementation of the stdout pump to finish writes regardless of previous context cancellations.

Motivation and Context

In few other pumps I've investigated (Splunk, Hybrid), the Pumps do not conditionally write based on context cancellations. Meaning, they always attempt to finish writing all records to their destination sinks. The STDOUT is the only Pump that purposefully closes attempts to finish writing based on any condition.

I've changed this behaviour so it now finishes all writes without being interrupted.

How This Has Been Tested

A unit test has been written that will force a cancellation context before the writes are started. Then, it will check to make sure all the writes took place. With the original implementation of stdout, this test failed. With the new implementation, this test passes.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • Modules and vendor dependencies have been updated; run go mod tidy && go mod vendor
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • Check your code additions will not fail linting checks:
    • go fmt -s
    • go vet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants