-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
UI freezes on fdatasync #7952
Comments
Looks like Qt parses this file on each time request and this can't be solved in tdesktop: |
Probably it's due to recent switching to QSaveFile to avoid logout on power outage, and it is called when saving drafts 🤔 |
Why tdesktop need a time request when hovering over the mouse cursor? |
🤔 probably, for tooltip or to update the time on the item |
@ilya-fedin I don't saw any actions by hovering (no hints, no time updates) in tdesktop And I think this is wrong(or old style) call: if (open(save, 's')) { |
No, it's FileWriteDescriptor::open |
You can't see any difference since it's the same post probably |
my disk io is slow and freezes are crazy long while I type new message ... |
This is so stupid bug - when running some io operations on filesystem (such as scrubbing on zfs) - Telegram is complete unusable. |
friend, put dir like this |
Thanks but this workaround is ugly. I think behaviour - when changes in input box is put to disk - must be configurable (off, custom period) and of course next need to be fix ui bug with freezes. |
@cypa Thanks, I tried this trick, it did entirely get rid of the freezing. Awesome! However, now my telegram desktop resets every time I restart my pc. Which means I have to login again, enter otp, and enter 2fa password every time, and it resets all my settings too :( This is expected since I loaded Telegram Desktop into RAM, but still :( |
Another workaround is to use eatmydata/libeatmydata, e.g. It "is designed to transparently disable fsync and friends" - the lack of write safety won't be a concern if you're already putting this data in volatile storage. I've updated my desktop shortcuts already... 😁 |
This workaroud unfortunately not working... |
Not working in what way, @rnz ? You can't get the preload to work, or it doesn't fix the issue completely? |
It doesn't fix the issue - freezes on input still present when telegram save text from input field |
This is rather annoying. Telegram sometimes flat out crashes when it hangs due to this, though that hasn't happened for a few weeks. I disabled Spellcheck and it still hangs when saving the draft. Is it trying to write to an actual file or save the draft to a cache in memory? Since I'm running on HDD, the freezing would be very prominent with the seek time. |
@ilya-fedin hi man! Is there any progress with fix this bug? |
I don't know, ask @john-preston |
@john-preston same question? |
@rnz I have a patch that moves all fdatasync-s to the background thread, I think I'll add it to the next beta release. |
@john-preston Still no solution even in the latest beta? The slowness during typing is very annoying. |
If that can help, I recently discovered that the TRIM was not enabled on my system because I encrypted my SSD through dm-crypt and in that case TRIM is not automatically enabled for security purposes: https://wiki.archlinux.org/index.php/Dm-crypt/Specialties#Discard/TRIM_support_for_solid_state_drives_(SSD) |
@MartialGeek I already have TRIM activated for all drives. But it doesn't help. I will try to transfer Telegram Data to RAM drive. |
You had a different issue with spellchecker rather than with fdatasync IIRC, hadn't you? |
@ilya-fedin Yes, there was a problem with the spellchecker when the processor got overloaded when typing long words or ".........." (many special characters). This problem has been fixed, thanks for that. But the problem with microlags while typing doesn't disappear even if you turn off spellchecker. OS: Windows 10 x64 1803 |
Why don't you close your issue then? |
@ilya-fedin I'm going to close now, referring to this thread. |
@grandsilence Today (I hope) will be a next stable release, then maybe some bug-fix releases and then I hope to deploy a new beta version where I'll try to enable moving all fdatasync-s to a background thread. |
@john-preston Thank you very much. I'll be waiting. |
How long to wait? |
@john-preston any news about the issue? |
@grandsilence @rnz new beta 2.7.5 with fdatasync in background thread, check it out If it doesn't fix the freezing for you there's still cypa's trick which works flawlessly |
@Younes-L Switched to new beta 2.7.5. Looks like the problem has been solved! |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Steps to reproduce
About ui freezes
Expected behaviour
No UI freezes on background io operations
Actual behaviour
Freezes.
Configuration
Operating system:
$ lsb_release -a
LSB Version: core-11.1.0ubuntu2-noarch:printing-11.1.0ubuntu2-noarch:security-11.1.0ubuntu2-noarch
Distributor ID: Ubuntu
Description: Ubuntu 20.04 LTS
Release: 20.04
Codename: focal
Version of Telegram Desktop:
2.1.7
Installation source (Linux Only) - the official website / GitHub releases / flatpak / snap / distribution package:
GitHub releases
Used theme:
Night
Additional info:
My /home placed on zfs pool (two hdd in mirror with zlog on nvme ssd) and zfs before version 0.8 didn't support O_DIRECT and operation fdatasync didn't wait disk io. But now zfs support O_DIRECT and operations such as fdatasync now have write time penalties. And for example now when zfs run scrub Telegram is almost completly unusable by freezes because too often call sync operations and not exec this operations in background and have impact on the user interface.
I think fdatasync doesn't need for Telegram - linux fs drivers, vfs and also zfs write stack already have own tunable strategy for sync. But if Telegram is need fsyncdata - that operation must be run in background without impact UI
Also Telegram have too many operations stat("/etc/localtime", ...) on mouse hover action on groups:
I think this is overhead too
The text was updated successfully, but these errors were encountered: