bugGNU Parallel - build and execute command lines from standard input in parallel - Bugs: bug #32193, ssh keeps running if parallel is...

 
 

bug #32193: ssh keeps running if parallel is killed

Submitted by:  Ole Tange <tange>
Submitted on:  Thu 20 Jan 2011 04:31:15 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Postponed
Privacy: PublicAssigned to: Ole Tange <tange>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 22 Feb 2011 02:52:20 PM UTCtangeOpen/ClosedOpen=>Closed
    Tue 22 Feb 2011 12:59:00 AM UTCtangeStatusConfirmed=>Postponed

    Back to the top


    Powered by Savane 3.1-cleanup1