Page MenuHomePhabricator

Command line modules plugin discards executable too soon (timeout)
Closed, ResolvedPublic

Description

If you specify an executable for the command line modules plugin (preferences->command line modules->additional modules) it checks if the executable responds with proper XML when called with the '--xml' argument. If there is no response for a while, the debug console says the process has timed out.

However, in my case it is a Matlab executable which typically takes a long time to respond because of the Matlab compiler runtime. It took several seconds even when I launched the exe (with '--xml') in cmd.
Unfortunately I cannot give you the precise debug output as I'm not able to recreate this scenario because the Matlab executable in question responds a lot faster on the second run.

I feel the timeout period should be longer - at least for Matlab executables.

Event Timeline

Assigning bug to sascha. This may be a CTK issue?

Hi All,

I just raised CTK issue 496, as we need better reporting of errors for 3rd party apps like MITK Workbench.

and pushed:
https://github.com/commontk/CTK/commits/496-cli-directory-watcher-errors

Then I integrated the latest changes from CTK into MITK Workbench and pushed:
https://github.com/NifTK/MITK/commits/bug-15427-trac-3594-cli-timeout

Can Sascha review?

Also, 2 questions:

a) Id like a 'Clear Cache' button, as on Mac, the path is normally something awkward like: /var/folders/6v/90sbqblx3gq45xhss4g5ckr40000gn/T/  but should this be a button on the front end, or a preference. We need access to ctkCmdLineModuleManager, which suggests it should be a front end button.
b) When any preferences is changed, the OnPreferencesChanged signal is emitted for each value that is written. This means that CommandLineModulesView gets called multiple times. Each time it is called, it sets the paths on the DirectoryWatcher, which causes stuff to be reloaded. So, for any/all modules that previuosly suffered a timeout exception, they will be repeatedly reloaded, leading to as many messages boxes explaining the error as there are preferences on the page.

Both branches updated.

a) I put in a preference to 'show advanced widgets', and then you get a 'clear XML cache' button and 'reload modules' button in the front end.

b) I cached the list of directories and executables so that we dont get too many error messages, but this should probably be fixed in blueberry.

zelzer added a subscriber: zelzer.Jul 11 2014, 3:21 PM

[a732a7]: Merge branch 'bug-15427-trac-3594-cli-timeout'

Merged commits:

2014-07-11 15:17:18 Sascha Zelzer [bc533c]
Updated to new CTK version.


2014-07-04 15:54:17 Matt Clarkson [2a27f0]
Implement 'Clear Cache', and 'Reload modules'


2014-07-04 15:04:56 Matt Clarkson [7e07a8]
Implement CLI 'show advanced widgets'


2014-07-04 14:49:39 Matt Clarkson [35534f]
Add CLI 'show advanced widgets' usr pref


2014-07-04 14:42:17 Matt Clarkson [86b266]
Cache directories and modules in view, so we don't repeatedly trigger Directory Watcher updates when prefs change


2014-07-04 14:22:50 Matt Clarkson [864bd2]
Process CLI directory watcher error messages


2014-07-04 11:10:25 Matt Clarkson [91409c]
Read/Write CLI XML timeout pref


2014-07-04 11:01:26 Matt Clarkson [338186]
Add extra tool tip to CLI prefs


2014-07-04 10:51:04 Matt Clarkson [37d3e2]
Re-arrange CLI prefs, save space


2014-04-15 21:19:06 Matt Clarkson [49916a]
Merge tag 'v2014.03.0' of http://git.mitk.org/MITK

MITK release 2014.03.0

User zelzer has pushed new remote branch:

bug-15427-trac-3594-cli-timeout

Thanks a lot for working on this.

(In reply to Matt Clarkson from comment #2)

Can Sascha review?

Looks good, so I merged your branch without modifications.

Also, 2 questions:

a) Id like a 'Clear Cache' button, as on Mac, the path is normally

something awkward like: /var/folders/6v/90sbqblx3gq45xhss4g5ckr40000gn/T/
but should this be a button on the front end, or a preference. We need
access to ctkCmdLineModuleManager, which suggests it should be a front end
button.

This is okay for me. However, we could think about creating a ctkCmdLineModuleManager object in a more central plug-in (e.g. org.mitk.core.services) and register the object as a service so that it can be retrieved by other plug-ins (views) or the prefernces page.

b) When any preferences is changed, the OnPreferencesChanged signal is

emitted for each value that is written. This means that
CommandLineModulesView gets called multiple times. Each time it is called,
it sets the paths on the DirectoryWatcher, which causes stuff to be
reloaded. So, for any/all modules that previuosly suffered a timeout
exception, they will be repeatedly reloaded, leading to as many messages
boxes explaining the error as there are preferences on the page.

Sounds like a bug, I would need to investigate this more.

[d88705]: Merge branch 'bug-15427-trac-3594-cli-timeout'

Merged commits:

2014-07-12 11:05:48 Sascha Zelzer [d8e998]
COMP: Use fixed CTK for Visual Studio.