Watchdog bug in 2.4.0

Please let our ADS show!

This sites offers only FREE software and it's supported by a few advertisement boxes (no intrusive popups).
Please:

  • disable your AdBlocker by adding CoolSoft website to whitelist
  • give the proper cookie consent
  • enable JavaScript for this website

This seconds wait is to let you update your browser configuration...

Ok, I've done the required changes... now show me your content!
!!! Please enable JavaScript !!!

Pages

Posts: 18
Joined: January 1, 2016 - 17:54
Re: Watchdog bug in 2.4.0

PS: Can YOU change the title of this post? E.g. to "Watchdog problem in 2.4.0" ?

Posts: 1972
Joined: March 25, 2012 - 01:19
Re: Watchdog bug in 2.4.0
bassklampfe wrote:
Is there a reason to use a watchdog? On midiOutOpen you sample the process id of the caller (you show it in the VMS/About status info). Wouldn't it be sufficient to monitor, if the process still exists? In which situation is an "IsWatchDogTriggered()" better than a "DoesProcessStillExist()" ?

The process could exist but be hung, stuck or deadlocked (with notes playing around). Think about a misbehaving multithreaded MIDI player.
It happened a lot of times in the past with misbehaving clients; MIDI is an ancient protocol and a lot of people still use MIDI tools written in the Windows 9x era ;)

Current watchdog implementation is really simple and lightweight: each opened virtual device is expected to send at least one MIDI message within watchdog time (8000ms).
Both driver and synth have a counter of messages sent/received through the IPC channel; at each watchdog run, the counter is checked and, if zero, a "fake" message is sent (driver side) or the device is forcibly closed (synth side).

This is really fast and does not call external APIs like EnumProcesses().

I'd like to keep the current implementation that covers all of the cases above.
Anyway your suggestion is architecturally easier (synth side only watchdog checking process IDs); will rethink about it in the future.

Posts: 1972
Joined: March 25, 2012 - 01:19
Re: Watchdog bug in 2.4.0

I've found the bug: it was a race condition between the two watchdogs, due to a wrong initialization at server side.
It has effect only at first connection of a client if it opens the device and does not send any other message within the first watchdog run, exactly what your client does...

I've not backported the fix to 2.4.0 but applied it to 2.5.0-beta2 here.
Please test it and report your feedback in this thread.

Posts: 18
Joined: January 1, 2016 - 17:54
Re: Watchdog bug in 2.4.0
coolsoft wrote:
Please test it and report your feedback in this thread.

Quick check looks fine. Will test in deep in the weekend.

Regards

Pages