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

File locked during deletion - fix #14

Merged
merged 6 commits into from
Sep 29, 2023

Conversation

apoorva918
Copy link
Contributor

This update will obtain a lock on the file before triggering deletion. If the lock is not acquired, file deletion will be skipped and retried.

Testing:
Tested using a python script to lock the file. The file was ingested and deleted after the lock was released.

@sachin-j-joshi sachin-j-joshi self-assigned this Sep 27, 2023
state.deleteCompletedFile(file.fileName);
}
else{
log.info("Unable to obtain lock");
Copy link
Contributor

Choose a reason for hiding this comment

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

Add file name to message.
Also, should this be WARN?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

log.warn("Unable to delete ingested file {}", e);
// We can continue on this error. It will be retried on the next iteration.
log.warn("Unable to delete ingested file {}", e.getMessage());
log.warn("File is locked by another process. Will retry deletion.");
Copy link
Contributor

Choose a reason for hiding this comment

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

This log line will be written for any exception not just when file is locked.
This is not correct we should have this message only when it is really locked by other process.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've modified it.

log.warn("Unable to delete ingested file {}", e);
// We can continue on this error. It will be retried on the next iteration.
log.warn("Unable to delete ingested file {}", e.getMessage());
log.warn("File is locked by another process. Will retry deletion.");
Copy link
Contributor

Choose a reason for hiding this comment

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

same as above

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've modified it.

@sachin-j-joshi sachin-j-joshi merged commit c6ada06 into pravega:master Sep 29, 2023
1 check passed
@apoorva918 apoorva918 deleted the psc-file-lock-fix branch September 29, 2023 17:06
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