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

persist-state: Clean up the temporary file upon destroy #73

Merged
merged 1 commit into from
Jan 22, 2014
Merged

persist-state: Clean up the temporary file upon destroy #73

merged 1 commit into from
Jan 22, 2014

Conversation

algernon
Copy link
Contributor

When destroying a persist state, unlink the temporary file too, as to
not leave junk behind. Added test cases for both the commit() +
destroy() and the cancel() + destroy() cases. With this fixed, the
persist files created during make check need not be in CLEANFILES.

Signed-off-by: Gergely Nagy algernon@balabit.hu

When destroying a persist state, unlink the temporary file too, as to
not leave junk behind. Added test cases for both the commit() +
destroy() and the cancel() + destroy() cases. With this fixed, the
persist files created during make check need not be in CLEANFILES.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
@bazsi
Copy link
Collaborator

bazsi commented Jan 22, 2014

are you sure it is a good idea to remove the file if the persist-state object is destroyed? it is the file that contains our current file positions and if it gets removed at shutdown, how would the data in it survive a restart?

@algernon
Copy link
Contributor Author

It removes the backup file, not the main one.

@algernon
Copy link
Contributor Author

There is actually a test that verifies that the persist file does not get deleted when it needs to stay. If I break the code, and remove ->commited_filename instead of ->temp_filename in _destroy(), the test breaks, as it should.

@bazsi
Copy link
Collaborator

bazsi commented Jan 22, 2014

my bad. I'll merge this then.

bazsi added a commit that referenced this pull request Jan 22, 2014
…eanup

persist-state: Clean up the temporary file upon destroy
@bazsi bazsi merged commit 358aa0b into syslog-ng:master Jan 22, 2014
@algernon algernon deleted the merge/h/persist-state-destroy-cleanup branch January 22, 2014 19:12
bazsi pushed a commit to bazsi/syslog-ng that referenced this pull request May 17, 2024
syslog-ng: install package signing public key after generation
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