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

Propagation of library updates to the embedded kiwix server #714

Merged
merged 3 commits into from
Nov 3, 2021

Conversation

veloman-yunkan
Copy link
Collaborator

Fixes kiwix/libkiwix#629

The problem is solved by fully recreating the name mapper whenever the library changes. An alternative solution was to add new methods addBook() and removeBook() to HumanReadableNameMapper (or to a new subclass of it).

The primary goal was to constrain the fix to a single repo (so that the reported issue is promptly resolved by one PR). However, this or the alternative solution will need to be migrated to libkiwix so that it can be reused for kiwix/kiwix-tools#243.

The new helper class `KiwixApp::NameMapperProxy` serves as a level of
indirection for `kiwix::HumanReadableNameMapper`. It will help to solve
the problem of updating the mapping when the library changes.
The chosen synchronization scheme between update() and
getNameForId()/getIdForName() optimizes the duration of the critical
sections - the getNameForId()/getIdForName() operations are not locked
for their full duration of execution.
Copy link
Member

@mgautierfr mgautierfr left a comment

Choose a reason for hiding this comment

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

The solution should be moved in libkiwix soon but I agree we can go with this "local" solution and move it to libkiwix with the work on kiwix/kiwix-tools#243

@mgautierfr mgautierfr merged commit 7c0a249 into master Nov 3, 2021
@mgautierfr mgautierfr deleted the uptodate_name_mapper branch November 3, 2021 13:15
@kelson42
Copy link
Collaborator

kelson42 commented Nov 3, 2021

@veloman-yunkan @mgautierfr I just tested, and the symptom described in my ticket kiwix/libkiwix#629 ist still there.

@veloman-yunkan
Copy link
Collaborator Author

@veloman-yunkan @mgautierfr I just tested, and the symptom described in my ticket kiwix/libkiwix#629 ist still there.

@kelson42 Something is wrong with your testing. It works for me. Did you build the code yourself? Are you sure that the fix is included in your build?

veloman-yunkan added a commit to kiwix/libkiwix that referenced this pull request Nov 20, 2021
The right place for NameMapperProxy introduced by
kiwix/kiwix-desktop#714 is in libkiwix (so that it can be reused in
kiwix-serve).
veloman-yunkan added a commit to kiwix/libkiwix that referenced this pull request Nov 21, 2021
veloman-yunkan added a commit to kiwix/libkiwix that referenced this pull request Nov 22, 2021
The right place for NameMapperProxy introduced by kiwix/kiwix-desktop#714 is in
libkiwix (so that it can be reused in kiwix-serve).
veloman-yunkan added a commit to kiwix/libkiwix that referenced this pull request Nov 30, 2021
The right place for NameMapperProxy introduced by kiwix/kiwix-desktop#714 is in
libkiwix (so that it can be reused in kiwix-serve).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Catalogue dialog content are not immediatly available on kiwix-serve
3 participants