Bug in manage_boot_clients_script (121 Views)
Reply
Occasional Contributor
jbagley2
Posts: 11
Registered: ‎07-09-2013
Message 1 of 1 (121 Views)

Bug in manage_boot_clients_script

[ Edited ]

I found a bug in "manage_boot_clients_script" exploited by running multiple simultaneous instances of the script.  At least one instance will fail with the following error:

 

"/opsw/apx/runtime/script/osprov.manage_boot_clients_script/bin/server_update_lib.py", line 746, in runIntegrationHook tempdir = getOutputDir(results) File "/opsw/apx/runtime/script/osprov.manage_boot_clients_script/bin/server_update_lib.py", line 732, in getOutputDir os.makedirs(outputdir) File "/opt/opsware/ogfsutils/lib/python2.4/os.py", line 159, in makedirs mkdir(name, mode) OSError: [Errno 17] File exists: '/home/hpoo/.mbc/1398715579.35' ;}

The root cause is in a function around line 732 of "server_update_lib.py" where a timestamp is used to create a temporary directory.  The time resolution appears to get truncated to tenths of a second, which negates some of the execution delays creating different values between instances.  The end result is occasional and unreproduceable failures.

 

I devised a workaround to pause for a random period of time before calling the script:

 

sleep 1.$(((RANDOM % 100) + 1)) && /opsw/apx/bin/osprov/manage_boot_clients_script

 

Hopefully this helps someone else!

 

 

Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation