-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Constant polling of database file due to hash checks #3699
Comments
What file system are you storing your DB on? Polling for changes in the database file is the fallback if inode watching isn't possible. This happens mostly on FUSE remote file systems. |
KeePassXC - 2.5.0 |
My db file is on Dropbox and encrypted with Cryptomator.
Strangely this only started happening with the latest update of keepassxc, hence I assumed the issue was here. |
I can reproduce constant polling of various sockets. Two being inotify sockets, the other two probably related to DBus and X11. Enabling browser integration adds another socket to the list. I cannot reproduce KeePassXC actually reading the file (that's what inotify is for anyway). What you are seeing may be introduced by #3612, though. Since I do not see inotify polls in your strace logs, I assume that for some reason inotify polling failed, so KeePassXC resorts to comparing file hashes instead. |
Now I get browser add-on access questions on a regular base. |
KeePassXC-Browser issues are not related to file polling. Please report those in a separate bug report. |
@phoerious thanks for your inputs. Anything else I can do from my side to give more detail or help in debugging this? |
No need to debug further, this is the new hashing check. It does it every second. We will be looking into that frequency in 2.5.1 |
Just fyi, on an SMB share with two databases (72K and 232K in size) this causes a constant downstream of 2.5Mbps. |
Uh how is that possible if we poll once per second? |
Ok, slight correction, nethogs and iftop probably poll only once per second, running |
Don't worry I have an idea on how to fix this and also reduce data usage. I totally neglected the fact that ANY change to the database will cause the encrypted portion to be totally different. As such, I really only need to hash the first KiB or two of the file to determine if it changed. |
* Fix #3699 Reduce file watch hashing of open database files from every second to every 30 seconds. Additionally, only hash the first 1024 bytes of the database file. This is valid since most of the header and the entire encrypted portion are changed significantly on every save.
* Fix #3699 Reduce file watch hashing of open database files from every second to every 30 seconds. Additionally, only hash the first 1024 bytes of the database file. This is valid since most of the header and the entire encrypted portion are changed significantly on every save.
It would probably be a good idea to rely on async I/O if possible. If the network is unreliable or was lost in-between, the file check would trigger a remount of e.g. a network share (webdav/sftp/...) which causes a big delay independent from the actual amount of data that is being transferred. Implementing file access in a non-blocking way would probably lead to a much smoother experience with unreliable network situations. For reference: #1799 is the feature which causes the problem |
That feature has been merged since 2.4.0. Agree though, we should be doing the hash check asynchronously. |
I experience the same issue on Manjaro with version 2.5.0. |
* Fix keepassxreboot#3699 Reduce file watch hashing of open database files from every second to every 30 seconds. Additionally, only hash the first 1024 bytes of the database file. This is valid since most of the header and the entire encrypted portion are changed significantly on every save.
Current Behavior
I can see that the database file is constantly accessed after upgrading to 2.5.0.
The same behavior can be seen if do
strace
on the pid of the keepassxc process.This started happening when I updated to 2.5.0 though I've been using the ppa for Ubuntu 18.04 and the last previous version available is 2.3.1
Debug Info
KeePassXC - 2.5.0
Operating system: Ubuntu 18.04
Kernel: 5.0.0-32-generic
The text was updated successfully, but these errors were encountered: