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

Investigate if fcitx5 -r may lose unsaved data #674

Open
wengxt opened this issue Nov 27, 2022 · 1 comment
Open

Investigate if fcitx5 -r may lose unsaved data #674

wengxt opened this issue Nov 27, 2022 · 1 comment

Comments

@wengxt
Copy link
Member

wengxt commented Nov 27, 2022

This just come to my mind today. Right now, fcitx5 -r uses dbus name "replace" machanism to restart fcitx5.

This actually causes a race condition that:

  • when this happens, dbus module is already loaded, which means quite a few data are already loaded, including already loaded addon config etc.
  • The old instance of fcitx will only trigger "save" at this point. Which means there would be quite a few addon that may not save data already when new fcitx is initializing.

right now actually we may be blocked by XIM (xim commonly need retry upon start up) and accidentally avoided this race in real life, but we should try to do better here by introducing some mechanism for waiting the old instance to quit gracefully.

@wengxt
Copy link
Member Author

wengxt commented Dec 1, 2022

At least "Restart" in tray menu won't lose data because it will call "save" before the actual restart, so that part is good.

Ideally, if fcitx5 -r is requested, new fcitx should send a request Exit method call if there is an existing owner. After that, request the name to avoid race on data loading.

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

No branches or pull requests

1 participant