Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

--only does not work as expected

#81

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

Reported by Jason May · September 10th, 2008 @ 07:45 PM

State: resolved
Milestone: Future
Assigned to: macournoyer macournoyer

Activity

  1. macournoyer
    macournoyer
    • 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?

    September 17th, 2008 @ 05:34 PM

  2. Jason May
    Jason May

    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.

    September 18th, 2008 @ 12:06 PM

  3. macournoyer
    macournoyer

    Can you send a patch for this Jason?

    September 28th, 2008 @ 02:47 PM

  4. Jason May
    Jason May

    Done!

    My first try at forking a github repo.

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

    September 29th, 2008 @ 01:59 PM

  5. macournoyer
    macournoyer
    • State changed from open to resolved

    Awesome work Jason! I just pulled, thx!

    September 30th, 2008 @ 09:21 AM

  6. macournoyer
    macournoyer

    (from [3ffced68bd37defac3aebca75682562249c08e41]) Add changelog for last commit, [#81 --only does not work as expected state:resolved] http://github.com/macournoyer/th...

    September 30th, 2008 @ 09:21 AM

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.