I've written a basic JSV using the Perl example in 6.2u5.  I'm running
into a problem when a job is submitted with a comma passed as an
argument.

$ qsub echo 0,1 
Unable to run job: master got unknown command from JSV: "ERROR".
Exiting.

Here is the jsv.log (logging_enabled set to 1):
$ cat -n /tmp/jsv.log
     1  /nfs/cadtools/common/sge_tools/ma_grid/cn_jsv.pl started on Wed
Mar 16 14:52:39 2011
     2
     3  This file contains logging output from a GE JSV script. Lines
beginning
     4  with >>> contain the data which was send by a command line
client or
     5  sge_qmaster to the JSV script. Lines beginning with <<< contain
data
     6  which is send from this JSV script to the client or sge_qmaster
     7
     8  >>> START
     9  <<< SEND ENV
    10  <<< STARTED
    11  >>> PARAM VERSION 1.0
    12  >>> PARAM CONTEXT client
    13  >>> PARAM CLIENT qsub
    14  >>> PARAM USER bdobbie
    15  >>> PARAM GROUP caveo
    16  >>> PARAM CMDNAME echo
    17  >>> PARAM CMDARGS 1
    18  >>> PARAM CMDARG0 0,1
    19  <<< ERROR JSV script got PARAM command for non-list option
'CMDARG0' but the value '0,1' looks like a list
    20  >>> PARAM b y
    21  >>> PARAM cwd /nfs/users/bdobbie
    22  >>> PARAM e /dev/null
    23  >>> PARAM l_hard mem_tokens=1
    24  >>> PARAM m a
    25  >>> PARAM M [email protected]
    26  >>> PARAM N echo
    27  >>> PARAM o /dev/null
    28  >>> PARAM w w
    29  >>> BEGIN
    30  <<< LOG INFO %Warning: no queue specified, redirecting to
default queue
    31  <<< PARAM q_hard default
    32  <<< PARAM M 
    33  <<< PARAM M [email protected]
    34  <<< RESULT STATE CORRECT Job was modified before it was accepted
    35  >>> QUIT
    36  /nfs/cadtools/common/sge_tools/ma_grid/cn_jsv.pl is terminating
on Wed Mar 16 14:52:39 2011

Is this a bug?  I'd expect that JSV should be able to support this type
of command.  Has this ever been encountered before?

The relevant code is the "handle_command_param" subroutine in JSV.pm:
$ cat -n $SGE_ROOT/util/resources/jsv/JSV.pm | grep
handle_command_param\ \{ -A30
   149  sub handle_command_param {
   150     my ($key, @val) = @_;
   151     my $val = join ' ', @val;
   152
   153     if ($state eq 'started') {
   154        if (exists $is_list_command{$key}) {
   155           # parse $val into hashref
   156           #   $val contains something like 'foo=bar,baz=blub' or
'foo,bar,baz'
   157           my %h;
   158           for my $item (split /,/, $val) {
   159              my ($k,$v) = split /=/, $item;
   160              $h{$k} = $v;
   161           }
   162           $param{$key} = { %h };
   163        } else {
   164           # not list command
   165           if ($key eq 'A' || $val !~ /,/) {
   166              # the -A option can have any content, also a comma
   167              $param{$key} = $val;
   168           } else {
   169              # oops, but this looks like a list option (contains
a comma)
   170              jsv_send_error("JSV script got PARAM command for
non-list option '$key' but the value '$val' looks like a list");
   171           }
   172        }
   173     } else {
   174        jsv_send_error("JSV script got PARAM command but is in
state $state");
   175     }
   176  }
   177
   178  } # end of closure over %is_list_command
   179

I think an exception similar to "-A" (see line 165) should be added for
"CMDNAME" and "CMDARG\d+".  Does anyone see a problem with making that
change?

Thanks,
Brad

_______________________________________________
users mailing list
[email protected]
https://gridengine.org/mailman/listinfo/users

Reply via email to