I added ':max_hosts => 5' to the task definition. That made things... 
different. :-)

It doesn't appear to be limiting the number of hosts in each group. Instead, it 
seems to be specifying the number of times the task will be performed against 
all servers (notice it does the exact same thing 5 times):

* executing "if [ -f ~david/.bash_logout ]; then sudo mv ~david/.bash_logout 
~david/.bash_logout-`date +%s`; fi"
servers: ["web1", "web2", "web3", "search", "be1", "be2", "cache1", "cache2", 
"search1", "search2"]
* executing "if [ -f ~david/.bash_logout ]; then sudo mv ~david/.bash_logout 
~david/.bash_logout-`date +%s`; fi"
servers: ["web1", "web2", "web3", "search", "be1", "be2", "cache1", "cache2", 
"search1", "search2"]
* executing "if [ -f ~david/.bash_logout ]; then sudo mv ~david/.bash_logout 
~david/.bash_logout-`date +%s`; fi"
servers: ["web1", "web2", "web3", "search", "be1", "be2", "cache1", "cache2", 
"search1", "search2"]
* executing "if [ -f ~david/.bash_logout ]; then sudo mv ~david/.bash_logout 
~david/.bash_logout-`date +%s`; fi"
servers: ["web1", "web2", "web3", "search", "be1", "be2", "cache1", "cache2", 
"search1", "search2"]
* executing "if [ -f ~david/.bash_logout ]; then sudo mv ~david/.bash_logout 
~david/.bash_logout-`date +%s`; fi"
servers: ["web1", "web2", "web3", "search", "be1", "be2", "cache1", "cache2", 
"search1", "search2"]

I'm no longer getting ChannelOpenFailed. Instead, the first execution is 
succeeding and all the duplicate executions are failing (because they're now 
testing for a file that no longer exists). Eg:

** [out :: search.assistly.com] mv: cannot stat `/home/david/.bash_logout': No 
such file or directory
** [out :: search.assistly.com] mv: cannot stat `/home/david/.bash_logout': No 
such file or directory
** [out :: search.assistly.com] mv: cannot stat `/home/david/.bash_logout': No 
such file or directory
** [out :: search.assistly.com] mv: cannot stat `/home/david/.bash_logout': No 
such file or directory


Something weird appears to be going on, where the same task is being repeated 
on every server 'N server' times (or, now, ':max_hosts => 5' times). Previously 
it was repeated so many times that I'd get ChannelOpenFailed. Now, with 
:max_hosts set, it's repeating still, not causing ChannelOpenFailed, and 
instead flowing on to produce errors.

-- 
David Taylor

On Thursday, 31 March 2011 at 6:58 PM, Rafa García wrote: 
> Hi David,
> 
>  You could use the parameter :max_hosts in task definition. This parameter 
> defines de maximum number of hosts that should be selected to run this task 
> by groups.
> 
> Regards
> 
> 2011/3/31 [email protected] <[email protected]>
> >  When I run a task against quite a number of servers I get:
> > 
> >  /Users/david/.rvm/gems/ruby-1.9.2-p136/gems/net-ssh-2.1.0/lib/net/ssh/
> >  connection/channel.rb:524:in `do_open_failed': open failed (1)
> >  (Net::SSH::ChannelOpenFailed)
> > from /Users/david/.rvm/gems/ruby-1.9.2-p136/gems/net-ssh-2.1.0/
> >  lib/net/ssh/connection/session.rb:541:in `channel_open_failure'
> > from /Users/david/.rvm/gems/ruby-1.9.2-p136/gems/net-ssh-2.1.0/
> >  lib/net/ssh/connection/session.rb:456:in `dispatch_incoming_packets'
> > from /Users/david/.rvm/gems/ruby-1.9.2-p136/gems/net-ssh-2.1.0/
> >  lib/net/ssh/connection/session.rb:213:in `preprocess'
> > 
> >  If I reduce the number of servers by specifying any subset of those
> >  servers (eg, ":roles => :app") the task starts to work. I assume it
> >  has something to do with having too many simultaneous SSH connections
> >  or similar. I've checked the logs on the server end -- I can't see
> >  the server rejecting connections, so I'm assuming it's my client end
> >  failing to create that many connections.
> > 
> >  Other than trying to subdivide my task (which I've already done) is
> >  there anything else I can do?
> > 
> >  I'm using Ruby 1.9.2p136 (2010-12-25 revision 30365) [x86_64-
> >  darwin10.6.0] with Capistrano v2.5.19.
> > 
> >  Cheers,
> >  David.
> > 
> >  --
> >  * You received this message because you are subscribed to the Google 
> > Groups "Capistrano" group.
> >  * To post to this group, send email to [email protected]
> >  * To unsubscribe from this group, send email to 
> > [email protected] For more options, visit this group 
> > at http://groups.google.com/group/capistrano?hl=en
> > 
>  -- 
>  * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
>  * To post to this group, send email to [email protected]
>  * To unsubscribe from this group, send email to 
> [email protected] For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en 

-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to [email protected]
* To unsubscribe from this group, send email to 
[email protected] For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en

Reply via email to