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

Prevent closed block cache usage #250

Merged
merged 3 commits into from
Jan 29, 2025

Conversation

dobrac
Copy link
Contributor

@dobrac dobrac commented Jan 22, 2025

Prevent the ability to call read/write methods on already closed block cache in orchestrator, as it might cause invalid reads/writes. This might be simulated by closing the build cache right after creation while fetchToCache is still running.

Copy link

linear bot commented Jan 22, 2025

@dobrac dobrac added the improvement Improvement for current functionality label Jan 22, 2025
@dobrac dobrac self-assigned this Jan 22, 2025
Copy link
Member

@ValentaTomas ValentaTomas left a comment

Choose a reason for hiding this comment

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

I would consider using atomic.Bool for the close state instead of the channel. The channel should work ok, but the bool should be more clear.

@ValentaTomas
Copy link
Member

I think this looks good. If the (manual) testing is ok I think we can merge.

@dobrac
Copy link
Contributor Author

dobrac commented Jan 24, 2025

I think this looks good. If the (manual) testing is ok I think we can merge.

Manual testing is ok. Tested using low TTL value in build cache causing closing the diff before it's fully downloaded.

@ValentaTomas
Copy link
Member

I'll just do some testing before merging, but otherwise this looks good.

@ValentaTomas ValentaTomas merged commit 9a7bceb into main Jan 29, 2025
1 check passed
@ValentaTomas ValentaTomas deleted the prevent-closed-block-cache-usage-e2b-1471 branch January 29, 2025 02:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improvement for current functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants