--only does not work as expected
Reported by Jason May | September 10th, 2008 @ 07:45 PM | in Future
Given a thin.yml that defines 3 servers starting at port 3000, then with --only I would expect to be able to start them individually with
thin -C thin.yml --only 0 start thin -C thin.yml --only 1 start thin -C thin.yml --only 2 start
(because thin -h says: "-o, --only NUM Send command to only one server of the cluster")
But '--only' appears to interpret its argument as a port number, so this doesn't work. You can do
thin -C thin.yml --only 3000 start thin -C thin.yml --only 3001 start thin -C thin.yml --only 3002 start
This makes it hard to put thin under SMF, since then you have to embed the port numbers into the SMF manifest.
If you agree that have --only work by sequence-number instead of port, then I'll submit a patch.
Cheers, -Jason
Comments and changes to this ticket
-
macournoyer September 17th, 2008 @ 05:34 PM
- State changed from new to open
- Tag changed from cluster, config, docs to cluster, config, docs
Sorry for the late reply Jason,
--only w/ sockets already work like you described. --only w/ tcp ports works w/ port number.
I think it's more intuitive this way. But you could make --only w/ tcp ports work w/ port number AND sequence number.
I'm thinking something like this:
if @only < 80 # it's a sequence number else # it's a port number end
It would prevent having more then 80 servers, that's like crazy impossible!
What do you think?
-
Jason May September 18th, 2008 @ 12:06 PM
This sounds fine, and I think it satisfies the does-what-you-expect test.
I changed
with_each_server
incluster.rb
to doyield first_port + only.to_i
, which treats it always as a sequence number. I've never heard of anyone running more than 80 servers on the same box. -
Jason May September 29th, 2008 @ 01:59 PM
Done!
My first try at forking a github repo.
My fork, with changes, at http://github.com/jmay/thin/tree...
-
macournoyer September 30th, 2008 @ 09:21 AM
- State changed from open to resolved
Awesome work Jason! I just pulled, thx!
-
macournoyer September 30th, 2008 @ 09:21 AM
(from [3ffced68bd37defac3aebca75682562249c08e41]) Add changelog for last commit, [#81 state:resolved] http://github.com/macournoyer/th...
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
People watching this ticket
Referenced by
- 81 --only does not work as expected (from [3ffced68bd37defac3aebca75682562249c08e41]) Add cha...