Skip to content

ImageServiceImpl.getOrCreatePreview(): handle possible race gracefully #582

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

Open
php-coder opened this issue May 11, 2017 · 0 comments
Open

Comments

@php-coder
Copy link
Owner

It's possible that 2 threads will look for a preview of the same image, won't found it and both start to generate previews. First, we need to test that it won't produce exception (in case of in-memory database) and file corruptions (in case of using filesystem). Second, we should try to handle this case somehow to reduce double work in this case (can we use ConcurrentMap with image id that is currently in progress?).

Tech debt for: 5937d16 (#387)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant