Project monitor, not updating the "failed" overlay even when the fail disappear

18 views
Skip to first unread message

Daniel Sahlberg

unread,
Dec 3, 2022, 2:38:35 PM12/3/22
to TortoiseSVN-dev
Hi,

I've been observing that Project monitor display a "failed" overlay in the tree after intermittent failures, even when the failure has disappeared. This has also been discussed in the groups previously, for example [1]. I've been trying to reproduce this and I believe I've found the root cause.

High level description:
- Setup monitoring a project.
- On checking the projects (timer or Check now), there is an error. For example due to missing network connectivity. The project is now marked as failed and error is stored in MonitoringData.ini.
- Later network connectivity is restored. The check will succeed, however this is not stored in MonitoringData.ini. Thus, the project still has the "failed" overlay and you have to manually clear errors and check again.

An easy way to reproduce this is to enter a fake entry in the %systemroot%\System32\drivers\etc\hosts overriding DNS lookup for the Subversion server and then remove the same entry again for the second update.

I would prefer that intermittent failures clear themselves.

As far as I understand, monitoring is performed by a separate thread. This is using a separate vector of items to check. After check is completed, the data is copied back to the main list in OnMonitorThreadFinished().

The current implementation is to only update the main list if the lastHead has changed or if the item currently has an error message. Ie: If there previously was an error message but it has now disappeared, the update will not happen (unless there was a new revision). I would propose to change this to lastHead has changed or the error message has changed, as follows:

[[[
--- C:/Users/danie/AppData/Local/Temp/LogDlg.cpp-revBASE.svn001.tmp.cpp    lör dec  3 17:51:45 2022
+++ C:/Devel/tortoisesvn_trunk/src/TortoiseProc/LogDialog/LogDlg.cpp    lör dec  3 20:09:59 2022
@@ -9436 +9440 @@ void CLogDlg::OnMonitorThreadFinished()
-                if ((pItem->lastHead != item.lastHead) || (!item.lastErrorMsg.IsEmpty()))
+                if ((pItem->lastHead != item.lastHead) || (pItem->lastErrorMsg.IsEmpty() != item.lastErrorMsg.IsEmpty()))
]]]

I believe the same root cause is also relevant in another thread [2] claiming that url changes doens't always work - but MonitoringData snippet it seems the error message is not related to the current URL.

Kind regards,
Daniel


Daniel Sahlberg

unread,
Dec 4, 2022, 5:23:50 AM12/4/22
to TortoiseSVN-dev
lördag 3 december 2022 kl. 20:38:35 UTC+1 skrev Daniel Sahlberg:
[...]
+                if ((pItem->lastHead != item.lastHead) || (pItem->lastErrorMsg.IsEmpty() != item.lastErrorMsg.IsEmpty()))

On second thoughts, this is probably not the best solution. If there was an old error message and another error occurs, it will not be updated. Thus it should probably be
[[[
+                if ((pItem->lastHead != item.lastHead) || (pItem->lastErrorMsg != item.lastErrorMsg))
]]]

Kind regards,
Daniel

Stefan

unread,
Dec 5, 2022, 12:49:13 PM12/5/22
to TortoiseSVN-dev
this looks very good! Please commit.

It seems I can retire now :)
 
Stefan

Daniel Sahlberg

unread,
Dec 5, 2022, 3:45:41 PM12/5/22
to TortoiseSVN-dev
Thanks. I was mostly worried there was a design decision not to remove the error status. Committed as r29490.
 
It seems I can retire now :)

Please don't!  I'm sure you've forgotten more about Subversion than I will ever learn. :-)

Daniel

Reply all
Reply to author
Forward
0 new messages