Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: close sinks after records are written #448

Merged
merged 1 commit into from
Dec 8, 2022

Conversation

sudo-suhas
Copy link
Contributor

  • Split stream.Close() into Shutdown() and Close(). Shutdown() is
    expected to be called once all the records are extracted and Close()
    is expected to be called once all records are written by sinks. If
    Close() is called first, it will call Shutdown() internally.
  • Close the File instance in file sink's Close() method. Minor
    refactoring to improve perf for ndjson output (avoid string concat).

(builds on #446 to avoid conflicts)
Closes #380.

@sudo-suhas sudo-suhas force-pushed the close-sinks-after-write branch 4 times, most recently from 2f2ffbd to 48f7901 Compare December 2, 2022 08:44
@sudo-suhas sudo-suhas marked this pull request as ready for review December 2, 2022 08:45
@haveiss haveiss self-requested a review December 6, 2022 05:28
- Split stream.Close() into Shutdown() and Close(). Shutdown() is
  expected to be called once all the records are extracted and Close()
  is expected to be called once all records are written by sinks. If
  Close() is called first, it will call Shutdown() internally.
- Close the File instance in file sink's Close() method. Minor
  refactoring to improve perf for ndjson output (avoid string concat).
@sudo-suhas sudo-suhas merged commit d4d0e09 into main Dec 8, 2022
@sudo-suhas sudo-suhas deleted the close-sinks-after-write branch December 8, 2022 06:10
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.

fix: shutdown of connection to sink before publishing last record
2 participants