-
Notifications
You must be signed in to change notification settings - Fork 28
bugfix for #1853: garbage collector deletes guest users #1928
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
bugfix for #1853: garbage collector deletes guest users #1928
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1928 +/- ##
========================================
+ Coverage 69.0% 72.6% +3.6%
========================================
Files 350 351 +1
Lines 13314 13342 +28
Branches 1391 1392 +1
========================================
+ Hits 9191 9694 +503
+ Misses 3756 3267 -489
- Partials 367 381 +14
Flags with carried forward coverage won't be shown. Click here to find out more.
|
b25934d
to
cf36964
Compare
services/web/server/src/simcore_service_webserver/application.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please try to understand if there are any corner cases from what I've commented below.
services/web/server/src/simcore_service_webserver/studies_access.py
Outdated
Show resolved
Hide resolved
6575199
to
855dea4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should address the issue, due to the fact that the users are being used immediately after creation.
ca467ce
to
9478980
Compare
13dae60
to
d9b0297
Compare
- It reimplements the fix using locks to protect construction and initialization of the GUEST user from an eager GC! - This PR replaces PR#1928 (bugfix for #1853: garbage collector deletes guest users bug). This implementation avoid setting fictitious resources or anonymous users as in PR #1928. Those proved to be very error prone. - EXTRA: resources are removed from registry when GC actually executes the clean. This way, the share-lock mechanism will prevent a user from opening a resource that is being removed
What do these changes do?
Access to

/study/{study_id}
link producesThe reason is that the Garbage collector removes GUEST users when they have no resources associated. This caused that temporary GUEST users created in studies access were deleted even before their projects were associated.
This fix overcomes this problem by
access_study
is processed, a fictitious socket is created for the socket and it is turn into GUESTThis will prevent the GC to destroy the user before the
access_study
handle is completed and some extra time TTL to reconnect.pytest tests/unit/with_dbs/fast/test_access_to_studies.py
Related issue number
Fixes #1853
How to test
cd services/web make install-dev pytest --pdb -s --log-cli-level=DEBUG tests/unit/with_dbs/fast/test_access_to_studies.py
and can also see GC log.
Checklist
make openapi-specs
,git commit ...
and thenmake version-*
)