-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/66697/
-----------------------------------------------------------

(Updated April 19, 2018, 7:30 p.m.)


Review request for Aurora, Joshua Cohen and Zameer Manji.


Changes
-------

Move mocked_pid to a constant


Repository: aurora


Description
-------

My team has some scripts to start devel shards which create tunnels:

```
aurora task ssh -L 8002:http --ssh-options "-f -N" "$DC/$USER/devel/proxyapp/0"
aurora task ssh -L 9002:health --ssh-options "-f -N" 
"$DC/$USER/devel/proxyapp/0"
```

We use fixed local port numbers because that way we can run dependent services 
locally that look for locally-running copies of the
same service on a fixed port, but then those requests get tunnelled through to 
the devel shard.

When the devel shard is restarted, however, the tunnel is still running so the 
subsequent call to create a new tunnel fails because
it can't bind to the fixed port.

If we save the SSH process PID to a file, we can then kill existing tunnel to 
the old instance before starting up the new tunnel to the
new instance.


Diffs (updated)
-----

  src/main/python/apache/aurora/client/cli/task.py 
652a545072f161dbf854b3d6d273809b09d142e8 
  src/test/python/apache/aurora/client/cli/test_task.py 
a543d4a101c58149f8af265257d061ff5032049c 


Diff: https://reviews.apache.org/r/66697/diff/4/

Changes: https://reviews.apache.org/r/66697/diff/3-4/


Testing
-------

```
$ ./pants test src/test/python/apache/aurora/client::
```

And when applying the same patch to our local repo at Twitter:

```
$ ./pants run 
twitter/src/main/python/twitter/aurora/client/cli_internal:aurora_internal -- 
task ssh -L 8005:http --ssh-options "-n -N" --pid-file /tmp/p 
"smf1/sbrenn/devel/proxyapp/0" &
$ ps -p `cat /tmp/p`
  PID TTY           TIME CMD
34729 ttys000    0:00.05 ssh -t -n -N -L 
8005:smf1-aki-27-sr1.prod.twitter.com:31794 
sbr...@smf1-aki-27-sr1.prod.twitter.com cd 
/var/lib/mesos/slaves/*/frameworks/*/exec
```


Thanks,

Sameer Brenn

Reply via email to