Skip to content
This repository has been archived by the owner on Dec 7, 2018. It is now read-only.

Refactor Reel::Server, refactor/retrofit/abandon SocketMixin #121

Merged
merged 49 commits into from
Dec 12, 2013
Merged

Refactor Reel::Server, refactor/retrofit/abandon SocketMixin #121

merged 49 commits into from
Dec 12, 2013

Conversation

digitalextremist
Copy link
Member

Closes #114, Closes #119, Closes #120

@stouset
Copy link
Contributor

stouset commented Nov 13, 2013

Shouldn't the class names be updated to reflect their new location? e.g., Reel::Server::SSL, Reel::Server::UNIX, etc.?

optimize_socket @tcpserver = Celluloid::IO::TCPServer.new(host, port)

server = Celluloid::IO::SSLServer.new(@tcpserver, ssl_context)
options.merge!({ :host => host, :port => port })
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this necessary if the TCPServer has already been established on the host/port?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is where the TCPServer is created though, which is then wrapped in IO::SSLServer and then the wrapped server is sent to Reel::Server at super(server, options, &callback)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I mean the merging of host and port into the options hash.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stouset I do that so the Server can be asked for what port it is on, and what host it is listening on. It is not necessary, per se, but I saved @options in Server and you'll see in UNIXServer I also save @options[:socket_path]

In what I've seen, implementations sometimes need to know the underlying options the server is configured for to know how to setup environments properly request by request, or connection by connection.

@digitalextremist
Copy link
Member Author

Didn't want to assume @tarcieri would want the Reel::Server* change, but I am open to that and it's not a huge change to add to the PR. I followed the queue of Reel::SSLServer

@stouset
Copy link
Contributor

stouset commented Nov 13, 2013

It looks like the SSLServer errors are due to the fact that the SSLServer no longer serves HTTP, but I'm not absolutely certain yet.

# TCP_CORK: TODO: tersely describe
# SO_REUSEADDR: TODO: tersely describe

if RUBY_PLATFORM =~ /linux/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you leave this out for the time being?

@tarcieri
Copy link
Member

In general I think it'd be good if you left the SocketMixin refactoring out of this PR and focused just on changing the class names

end

end
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HTTPServer looks like it can no longer be composed with SSLServer, which was the whole point of the original approach. :(

@digitalextremist
Copy link
Member Author

@tarcieri about to make all the requested changes in the next few minutes. Can we settle on keeping SocketMixin and just having that be the :TCP_NODELAY optimization for now, with no OS specific pieces?

My justification is that we have two TCPServer implementations now, with both deoptimization and optimization. It could just as easily be ServerMixins but since it handles a TCPSocket I kept SocketMixins

Starting on those changes.

@digitalextremist
Copy link
Member Author

Yeah, I did just plain rbx but I will do rbx-2 also.

@digitalextremist
Copy link
Member Author

Alright, the moment of truth... all tests running, with both rbx and rbx-2

@digitalextremist
Copy link
Member Author

rbx seems to do the same version as rbx-2 so we may as well choose only one.

@digitalextremist
Copy link
Member Author

Coming back to pull the trigger on this merge when you feel comfortable with the PR @tarcieri. rbx seems like it's going to be fine, and I can remove rbx-2 going forward.

@digitalextremist
Copy link
Member Author

@tarcieri you may want to check Gemfile per the comments made in travis-ci/travis-ci#1641 about it. What I added may not be necessary with the rbx fix.

And I will see if rbx-2 affects which ruby language version is tested.

@digitalextremist
Copy link
Member Author

...and rbx crashes into the terrain...

@tarcieri
Copy link
Member

@digitalextremist looks like you can probably just use "rbx". Surprised it's failing with rubysl in the Gemfile

I'd say let's just move rbx to allowed failures for now (and leave out rbx-2 since it's the same thing)

@digitalextremist
Copy link
Member Author

@tarcieri, after what we've just gone through and seen, this commit will pass. Newline added, and failure of rbx accepted, as well as rbx-2 removed.

@digitalextremist
Copy link
Member Author

All green with the one allowed red.

@digitalextremist
Copy link
Member Author

Last things that ought to be looked at later and can move to separate issues, which are @stouset territory:

All set to merge, and move those two things into their own issues.

Update: The issues were created, and added above.

@digitalextremist
Copy link
Member Author

Come to think of it @tarcieri, since this affects a lot of past code out there in the wild and will break that code, #126 ought to happen as simultaneously as possible. I am open to scheduling that at a point you are comfortable with it, volunteering to do the Wiki changes and then immediately come and merge this in once the documentation isn't one huge o_0 field of uhhh? And I could also write a post on the mailinglist about this unless someone else would be better.

@tarcieri
Copy link
Member

@digitalextremist this is definitely a breaking change that needs to be well-advertised, and I agree about #126

@digitalextremist
Copy link
Member Author

Cool @tarcieri, I am all over #126.

@tarcieri
Copy link
Member

Sweet, thank you!

@tarcieri
Copy link
Member

This is good to merge

digitalextremist added a commit that referenced this pull request Dec 12, 2013
Refactor Reel::Server, refactor/retrofit/abandon SocketMixin, depending on #126 immediately hereafter.
@digitalextremist digitalextremist merged commit e28dad8 into celluloid:master Dec 12, 2013
@digitalextremist digitalextremist deleted the refactor-servers branch December 12, 2013 03:55
@tarcieri
Copy link
Member

🎉 🎉 🎉 :shipit: 👍

@digitalextremist
Copy link
Member Author

😃 I'm stupid happy.

Wiki fully updated. Only thing left on #126 is the mailing list post.

Can you check over the Wiki when you get a chance?

@tarcieri
Copy link
Member

Sure, will probably be some time tomorrow

@digitalextremist
Copy link
Member Author

Cool @tarcieri, I am done for today then and left everything at #126 for you to go through when it's good for you.

@tarcieri
Copy link
Member

Thanks again!

@digitalextremist
Copy link
Member Author

My pleasure 👍

I am honored to step in, stick around, and see 1.0 & beyond spread far and wide.

@halorgium
Copy link
Contributor

Nice work! Now we need celluloid 1.0!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[SSL]Server.supervise_as broken after #116
4 participants