Bug 161168 - WebDav UCP - has (fairly) busy-loop in a thread refreshing locks
Summary: WebDav UCP - has (fairly) busy-loop in a thread refreshing locks
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: framework (show other bugs)
Version:
(earliest affected)
24.8.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Manish
URL:
Whiteboard: target:25.8.0
Keywords: difficultyInteresting, easyHack, skillCpp, topicCleanup
Depends on:
Blocks: WebDAV
  Show dependency treegraph
 
Reported: 2024-05-18 20:47 UTC by Michael Meeks
Modified: 2025-03-03 10:34 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Meeks 2024-05-18 20:47:07 UTC
It appears that:

ucb/source/ucp/webdav-curl/SerfLockStore.cxx

Hasa  thread that wakes up 25 times per second:

        std::this_thread::sleep_for( std::chrono::milliseconds(1000/25) );

to see if some timeouts have expired.

However - the method 'refreshLocks' could easily tell us how long it will be until we need to refresh another lock; and if we wait/sleep on a condition we can signal that if new ones are added.

This would make scheduling far more relaxed.

Suggest adding a shortest deadline in milliseconds to wake up again as a return value from 'refreshLocks()' there and sleeping that long.

=)
Comment 1 Michael Meeks 2024-05-18 20:48:14 UTC
Hi Michael; not sure if you're interested in this one =) but was a curio I stumbled over in some code reading there.
Comment 2 Commit Notification 2025-02-06 09:13:17 UTC
Manish Bera committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/867d380b0b8e2c59689eb42665c75aad34733bbc

tdf#161168 Improve constant repetitive loop thread

It will be available in 25.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.