#81 ✓resolved
Jason May

--only does not work as expected

Reported by Jason May | 2008-09-10 19:45:21 UTC | 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

    macournoyer 2008-09-17 17:34:48 UTC

    • 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

    Jason May 2008-09-18 12:06:28 UTC

    This sounds fine, and I think it satisfies the does-what-you-expect test.

    I changed with_each_server in cluster.rb to do yield 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.

  • macournoyer

    macournoyer 2008-09-28 14:47:30 UTC

    Can you send a patch for this Jason?

  • Jason May

    Jason May 2008-09-29 13:59:05 UTC

    Done!

    My first try at forking a github repo.

    My fork, with changes, at http://github.com/jmay/thin/tree...

  • macournoyer

    macournoyer 2008-09-30 09:21:03 UTC

    • State changed from “open” to “resolved”

    Awesome work Jason! I just pulled, thx!

  • macournoyer

    macournoyer 2008-09-30 09:21:04 UTC

    (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.

New-ticket Create new ticket

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

Pages