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 last temp file merge, bump core and package version #36

Merged
merged 5 commits into from
Dec 12, 2022

Conversation

balins
Copy link
Member

@balins balins commented Dec 8, 2022

The current implementation has a bug when using File.Sink and File.SeekEvent - on termination, the descriptors of opened files are closed before cleanup function from ResourceGuard are ran, what results in error when trying to copy the contents of the temporary file over to the main file. This error hasn't been noticed in other cases, since CommonFile.close! on a PID of a closed file descriptor doesn't raise, but returns :ok.
This PR makes use of handle_terminate_request/2 and ensures that the temporary file is merged before sink gracefully terminates. Since the file descriptors close themselves when the element that opened them terminates, I've replaced the resource guard with the callback implementation in other elements, too (their resource guards just tried to close already closed files anyway).

Also, updated CI config so we have Hex releases on tag push and bumped the patch version of the package.

@balins balins requested a review from FelonEkonom December 8, 2022 17:24
@@ -25,8 +21,6 @@ defmodule Membrane.File.Sink.MultiTest do

setup :state_and_ctx

setup :verify_on_exit!
Copy link
Member

Choose a reason for hiding this comment

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

Why have you deleted this?

Copy link
Member Author

Choose a reason for hiding this comment

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

use Membrane.File.TestCaseTemplate already sets this up

@balins balins merged commit b5735d3 into master Dec 12, 2022
@balins balins deleted the fix-last-temp-file-merge branch December 12, 2022 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants