CLONE - pbs.event().progname and pbs.event().argv settings are not remembered/propagated under multiple hooks

Description

[old title]: Hook execjob_launch ignoring hooks except only for last hook

When there are two execjob_launch hooks, hook1, hook2 - it seems the code in hook1 is Not Effective or Not Activated.
hook1 is ignored - but my testing shows error messages is printed by hook1, but this command is ignored:
pbs.event().progname = '/abc/def'

Create hooks in qmgr:
--------------------------
create hook execjob_launch_1
set hook execjob_launch_1 order = 1
set hook execjob_launch_1 event = execjob_launch
import hook execjob_launch_1 application/x-python default test_hook_1.py
set hook execjob_launch_1 enabled = true

create hook execjob_launch_2
set hook execjob_launch_2 order = 2
set hook execjob_launch_2 event = execjob_launch
import hook execjob_launch_2 application/x-python default test_hook_2.py
set hook execjob_launch_2 enabled = true

test_hook_1.py
------------------
import pbs
pbs.logmsg(pbs.LOG_DEBUG, 'xxx execjob_launch ' )
pbs.event().progname = '/abc/def'

test_hook_2.py
------------------
import pbs

  1. Do NOTHING
    pbs.event().accept()

qsub test.sh
---------------
#!/bin/bash
date

Reproducing:
-----------------
as user: qsub test.sh
---> job id = 33 (see printout below, search for 'xxx' as the marker)
as root: qmgr -c ' s h execjob_launch_2 enabled=false'
as user: qsub test.sh
---> job id = 34 (see printout below, search for 'xxx' as the marker)

when two hooks are enabled, hook1 is not executed.
My test shows hook1 IS executed: job 33 is when two hooks are enabled, job 34 is when only hook1 is enabled (disable hook2) - because Mom log shows 'xxx' and progname being changed.

HOWEVER, looking at the log files:
job 34 has *.e file which is EXPECTED and says:
[user@m2 execjob_launch]$ more test.sh.e34
pbs_mom, exec of /bin/bash failed with error: No such file or directory

but job 33 has NO *.e file, indicating that the job ran as normal. also *.o shows job 33 ran with no problems
[user@m2 execjob_launch]$ more test.sh.o33
Fri Oct 9 02:47:21 AEDT 2015
------>>> THIS IS UNEXPECTED because the progname has changed: pbs.event().progname = '/abc/def'

Fri Oct 9 02:46:46 AEDT 2015
[root@m2 mom_logs]# tail -f 20151009
snip
10/09/2015 02:43:44;0006;pbs_python;Hook;pbs_python;Variable is: PBS_O_PATH=/opt/pbs/default/bin:/usr/local/bin:/usr/bi
:/usr/local/sbin:/usr/sbin:/home/user/.local/bin:/home/user/bin
10/09/2015 02:43:44;0008;pbs_mom;Job;32.m2;kill_job
10/09/2015 02:46:06;0100;pbs_mom;Req;;Type 85 request received from root@IPaddrort, sock=1
10/09/2015 02:46:06;0080;pbs_mom;Hook;dockjob_launch.HK;copy hook-related file request received
10/09/2015 02:46:21;0100;pbs_mom;Req;;Type 85 request received from root@IPaddrort, sock=1
10/09/2015 02:46:21;0080;pbs_mom;Hook;dock_shutdown.HK;copy hook-related file request received
10/09/2015 02:47:21;0100;pbs_mom;Req;;Type 1 request received from root@IPaddrort, sock=1
10/09/2015 02:47:21;0100;pbs_mom;Req;;Type 3 request received from root@IPaddrort, sock=1
10/09/2015 02:47:21;0100;pbs_mom;Req;;Type 5 request received from root@IPaddrort, sock=1
10/09/2015 02:47:21;0006;pbs_python;Hook;pbs_python;xxx execjob_launch
10/09/2015 02:47:21;0100;pbs_python;Hook;execjob_launch_1;progname orig: /bin/bash
10/09/2015 02:47:21;0100;pbs_python;Hook;execjob_launch_1;progname new: /abc/def
10/09/2015 02:47:21;0008;pbs_mom;Job;33.m2;Started, pid = 21277
10/09/2015 02:47:21;0080;pbs_mom;Job;33.m2;task 00000001 terminated
10/09/2015 02:47:21;0008;pbs_mom;Job;33.m2;Terminated
10/09/2015 02:47:21;0100;pbs_mom;Job;33.m2;task 00000001 cput= 0:00:00
10/09/2015 02:47:21;0008;pbs_mom;Job;33.m2;kill_job
snip

[root@m2 mom_logs]# qmgr -c ' s h execjob_launch_2 enabled=false'

[root@m2 mom_logs]# tail -f 20151009
snip
10/09/2015 02:48:34;0100;pbs_mom;Req;;Type 3 request received from root@IPaddrort, sock=1
10/09/2015 02:48:34;0100;pbs_mom;Req;;Type 5 request received from root@IPaddrort, sock=1
10/09/2015 02:48:34;0006;pbs_python;Hook;pbs_python;xxx execjob_launch
10/09/2015 02:48:34;0100;pbs_python;Hook;execjob_launch_1;progname orig: /bin/bash
10/09/2015 02:48:34;0100;pbs_python;Hook;execjob_launch_1;progname new: /abc/def
10/09/2015 02:48:34;0008;pbs_mom;Job;34.m2;Started, pid = 21504
10/09/2015 02:48:36;0080;pbs_mom;Job;34.m2;task 00000001 terminated
10/09/2015 02:48:36;0008;pbs_mom;Job;34.m2;Terminated
10/09/2015 02:48:36;0100;pbs_mom;Job;34.m2;task 00000001 cput= 0:00:00
10/09/2015 02:48:36;0008;pbs_mom;Job;34.m2;kill_job
10/09/2015 02:48:36;0100;pbs_mom;Job;34.m2;m2 cput= 0:00:00 mem=0kb
snip

Acceptance Criteria

None

Status

Assignee

Unassigned

Reporter

Former user

Severity

None

OS

None

Start Date

None

Pull Request URL

None

Components

Priority

High
Configure