-
Notifications
You must be signed in to change notification settings - Fork 412
User: skip broken users in gallery (47791) #11638
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
schmitz-ilias
wants to merge
2
commits into
ILIAS-eLearning:release_10
Choose a base branch
from
schmitz-ilias:bt-47791
base: release_10
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Should we really do this? This will lead to N additional SQL queries being fired.
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.
I'm not sure we can catch this any other way than with additional queries. As far as I can tell, the first time
usr_datais read out in the call from the ticket is in the constructor ofilObjUser, immediately before the error occurs. As @kergomard said in the ticket, there is really no good way to get out of the failed instantiation of the user once we get to that point.It would of course be possible to do the check with a single additional query.
Userwould have to offer some kind offilterOutBrokenUsersutility method, so that we are able to do the check at scale. Not sure where that would go, adding another static method toilObjUserseems ill advised.I guess a different fix here would involve (periodically?) cleaning up broken users before they become a problem. Or did you have something else in mind?
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.
Hi Tim,
Thanks for the detailed explanation. I think your assessment is correct: within the current architecture there is probably no easy way to avoid the additional queries once we instantiate
ilObjUser, because the consistency issue is only detected during object construction.Personally, I find the idea of periodically checking and cleaning up broken records quite compelling. Since I do not expect ILIAS to adopt (component-spanning) database-level referential integrity constraints in the foreseeable future (the topic has been discussed multiple times over the years, including workshops and proposals documented in the "Feature Wiki"), I think periodic and manually triggerable integrity checks are probably the most pragmatic long-term solution.
In fact, I could imagine extending the "System Check" infrastructure in a more generic way. Instead of relying on hard-coded task definitions, components could contribute integrity checks and optional cleanup tasks through artifacts or future component integration mechanisms. A generic "Integrity Cleanup" framework could then detect and optionally repair/delete orphaned or otherwise inconsistent records across the system. Besides improving data integrity, this would likely also have a positive impact on the performance of long-running installations.
Regarding alternatives, I can think of a few options:
ilErrorHandler::raiseError(..., FATAL)inilObjUserwith regular exceptions that consumers can catch and handle gracefully.ilObjUseraltogether in this context and introducing a dedicated gallery-facing entity (e.g.GalleryProfile) that exposes only the data required by the "Gallery" domain and can be loaded efficiently from a dedicated repository (ensuring the integrity of these provided entities).That said, I fully agree that most of these ideas go well beyond the scope of a bug fix. I mainly wanted to point them out because performance and data consistency issues tend to become increasingly visible in larger and older installations.
In the hosting environments I am involved with (passively), we have observed measurable performance regressions when comparing ILIAS 8, 9 and 10 under otherwise comparable usage scenarios and data volumes. While the reasons are often multifaceted and not attributable to a single change, the overall trend is noticeable.
Beyond my own observations, similar concerns are raised within the "SIG ILIAS betreiben", suggesting that this is not merely an isolated experience. Changes that introduce additional database queries therefore tend to attract my attention.
Best regards,
Michael