-
-
Notifications
You must be signed in to change notification settings - Fork 104
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
Conversation
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.
c3dbf7e
to
44ddebf
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.
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
@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? |
The right place for NameMapperProxy introduced by kiwix/kiwix-desktop#714 is in libkiwix (so that it can be reused in kiwix-serve).
The right place for NameMapperProxy introduced by kiwix/kiwix-desktop#714 is in libkiwix (so that it can be reused in kiwix-serve).
The right place for NameMapperProxy introduced by kiwix/kiwix-desktop#714 is in libkiwix (so that it can be reused in kiwix-serve).
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()
andremoveBook()
toHumanReadableNameMapper
(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.