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

tagObject Cid Refs Files Unintentionally Overwriting One Another #75

Closed
doulikecookiedough opened this issue Jun 21, 2024 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@doulikecookiedough
Copy link
Contributor

doulikecookiedough commented Jun 21, 2024

When multiple threads are called to tag the same object but with different pids, there could exist a possibility that a cid refs file gets generated the moment the existing code determines that it doesn't exist - causing a valid cid refs file to be overwritten rather than to be updated. This behaviour was observed in the Python library and fixed.

To Do:

  • Implement the same fix. We should not pre-check whether files exist or not and use those generated booleans to make decisions with. Instead, the flow should be checking for the files existence within each if statement
// Before
if (pidRefsFound && cidRefsFound) { ...

// What it should be
if (Files.exists(absPidRefsPath) && Files.exists(absCidRefsPath)) { ...
@doulikecookiedough doulikecookiedough added the bug Something isn't working label Jun 21, 2024
@doulikecookiedough doulikecookiedough changed the title tagObject Cid Refs Files Accidentally Overwriting One Another tagObject Cid Refs Files Unintentionally Overwriting One Another Jun 21, 2024
@doulikecookiedough
Copy link
Contributor Author

This has been completed via Bug-75: tagObject Cid Refs File Safety

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant