bugGNU Parallel - Bugs: bug #32193, ssh keeps running if parallel is...

 
 

bug #32193: ssh keeps running if parallel is killed

Submitter:  Ole Tange <tange>
Submitted:  Thu 20 Jan 2011 04:31:15 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Postponed
Privacy:  Public Assigned to:  tange
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 22 Feb 2011 02:52:20 PM UTC, comment #3: 

Using -tt for ssh causes remote output to have ^M as newlines.

This is unacceptable as we want the output to be the same whether the job is run on local machine or remote.

When ssh has an option to send the children signals please feel free to reopen this bug.

Ole Tange <tange>
Group administrator
Tue 22 Feb 2011 12:59:00 AM UTC, comment #2: 

This is probably the reason:

https://bugzilla.mindrot.org/show_bug.cgi?id=396

Using -tt makes the shell unclean for rsync.

See if we can use -tt for only running the command.

Ole Tange <tange>
Group administrator
Tue 22 Feb 2011 12:21:01 AM UTC, comment #1: 

What do I have to send to the children to make them kill off the other end of the SSH?

It seems ssh -tt helps, but it causes other problems (count no of cpus).

Maybe ssh has a special pass-signal option?


SERVER1=parallel-server3
SERVER2=parallel-server2

export BG_PROC

start_remote_sleep() {
  parallel -D -u -S parallel@$SERVER2 sleep ::: 370 &
  BG_PROC=$!
  while ! ssh parallel@$SERVER2 ps -A -o cmd | grep -q '^sleep 370' ; do
    sleep 0.3
  done
}

stop_local_parallel() {
  kill -9 $BG_PROC
}

check_and_stop_remote_sleep() {
  ssh parallel@$SERVER2 ps -A -o cmd | grep '^sleep 370'
  ssh parallel@$SERVER2 killall sleep
}

echo '### Test kill signals'
start_remote_sleep 2>/dev/null
kill -1 $BG_PROC
check_and_stop_remote_sleep


Ole Tange <tange>
Group administrator
Thu 20 Jan 2011 04:31:15 PM UTC, original submission:  

ssh can stay around if the remote end sends no data (sleep) after parallel has been killed with -2, -9, or -15.

If parallel is killed with CTRL-C the ssh's dies.

As -9 and -23 cannot be caught we probably cannot do anything about that.

But all other signals that cause parallel to stop should kill off the children aswell.

I believe the reason for seemingly inconsistent behaviour of CTRL-C is that the shell sends -2 to all children.

This shows the problem:

seq 1 100 | parallel  -S iris,login -j +0  "sleep 100;echo {}"

killall -2 parallel

pstree|grep ssh

Ole Tange <tange>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by tange (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-02-22 tange Open/ClosedOpen Closed
    2011-02-22 tange StatusConfirmed Postponed

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code