[wpkg-users] Global max execution time hardcoded?

Rainer Meier r.meier at wpkg.org
Mon Mar 25 16:41:28 CET 2013


Hi Marco,

On 22.03.2013 14:30, Marco Gaiarin wrote:
> Sorry Rainer, but... why?!
> Why keep an hardcoded value, when with a very little effort and no code
> ''disruption'' (it is only a default variable assignment!!!) we can make
> this customizable?

Sure you can have every potential internal setting configurable. But this will 
perhaps add another couple of hundred properties to the configuration file. I am 
usually a friend of configurable software too. In this case however I have to 
say that I don't see a reason to define a global timeout variable. The reason is 
that this global timeout will be per-command. And per-command we already have a 
property to define a meaningful timeout which is suitable for this specific command.
The global timeout however is there only to prevent that WPKG will just run 
forever. So the timeout value has to be pretty high in any case in order not to 
abort commands which just take long to complete. If you have a more clear 
picture on how long your commands will take to complete, then you should put 
this in the command attribute and not in the global one.
Timeouts in software deployment are a very difficult thing to handle especially 
in WPKG. Execution times vary a lot depending on hardware it runs on, disk 
performance, other system load etc. So as a rule of thumb I would never specify 
a timeout which is lower than at least 2 times the expected command run time.

Again I recommend to thin about the potential run-times of each command and 
define timeouts on command. The global timeout is fairly long on purpose and 
should just prevent WPKG from waiting forever. This might happen if the command 
you run waits for user input and therefore is not unattended.

I think it's a bad idea to let users configure a value which might easily create 
issues. For example users might think "well, my commands complete within less 
than a minute on my machine, let's set timeout to 1 minute". Then in production 
packages are installed from busy network, during startup (while machine is busy 
loading other services) etc. and suddenly it takes much longer and commands are 
terminated due to timeout.

So I really do not recommend to touch the default timeout. Neither in the code 
nor in configuration. So I see no reason to add it to the configuration file. I 
do however not prevent anybody to change it directly in the code. Everybody else 
can set longer/shorter timeouts per command.

br,
Rainer



More information about the wpkg-users mailing list