Skip to content

Library: GitProvider - Don't stop the app even if the library is not ready#639

Closed
eliska-n wants to merge 3 commits intomasterfrom
fix/library-gitprovider
Closed

Library: GitProvider - Don't stop the app even if the library is not ready#639
eliska-n wants to merge 3 commits intomasterfrom
fix/library-gitprovider

Conversation

@eliska-n
Copy link
Copy Markdown
Collaborator

I don't want the whole app to crash even when the git repo is not initialized.

With my edits and failure of the repo initialization, the Library won't get ready. The functionality of the application will be significantly impaired. It probably won't be repairable from the UI as even remote control needs Library to change things. However, we can at least keep the apps up and provide info to the UI about what is wrong. When all containers keep restarting because of typo in the library config, it is scary.

@eliska-n eliska-n requested review from ateska and mejroslav November 22, 2024 14:16
@eliska-n
Copy link
Copy Markdown
Collaborator Author

@eliska-n eliska-n self-assigned this Nov 26, 2024
@mejroslav mejroslav added the enhancement New feature or request label Nov 27, 2024
Comment thread asab/library/providers/git.py Outdated
else:
L.exception("Git repository not initialized: {}".format(err))
self.App.stop()
L.critical("Git repository not initialized: {}".format(err))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

"critical" error means that the app will exit ... otherwise this is an error (at all instances)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

in that case I only remove lines that stop the app

@eliska-n eliska-n requested a review from ateska December 10, 2024 12:49
@eliska-n
Copy link
Copy Markdown
Collaborator Author

return before set ready - the library should not be ready if the gitprovider fails.

)
else:
L.exception("Git repository not initialized: {}".format(err))
self.App.stop()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

return ... don't claim "library ready" - as discussed.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I added returns. But I tested it in the remote control. And remote control works even if the library is not ready. asab.library module does not restrict you to read from the library when library is not ready. So it is up to each microservice to check whether the library is ready before reading. Moreover, in remote control, I subscribe to changes in the Library on library ready. But the Library.ready! signal never comes. So, the remote control is running with wrong set of library layers and without the update of model. Which is serious.

I think we need to decide whether this should be solved on the asab level or on the microservice level and adjust first. Only then, this can be merged.

	async def _on_library_ready(self, event_name, library=None):
		# subscribe to /Site - that's wehere the model files are
		await self.App.LibraryService.subscribe(self.MODEL_PATH)
		self.App.TaskService.schedule(self.update_model_cache())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Library should not be usable if not ready.

@eliska-n eliska-n requested a review from ateska December 17, 2024 11:42
Copy link
Copy Markdown
Contributor

@ateska ateska left a comment

Choose a reason for hiding this comment

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

Implement feedback from @eliska-n :
Library should not be usable if any provider is not ready - including gitprovider.

@eliska-n
Copy link
Copy Markdown
Collaborator Author

Sorry, I probably forgot about this MR.
I think that Míra fixed it in later MRs.
I'm closing this one.

@eliska-n eliska-n closed this Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants