From dario_argento87 at hotmail.com Fri Jan 11 14:20:16 2008 From: dario_argento87 at hotmail.com (Steve G) Date: Fri, 11 Jan 2008 14:20:16 -0500 Subject: [Swiftiply-users] Multiple Apps Question Message-ID: My question is if Swiftiply can be used to handle multiple back end apps based on url? We currently use Apache 2 to reverse proxy to multiple Rails applications based on the url. For example: /sub will proxy to pen listening on localhost:3000 /admin will proxy to pen listen on localhost:3050 The Pen proxies then connect to each application's Mongrel Cluster. It looks like Swiftiply can handle multiple application only by hostname. I have not seen anything written about using it the way I need it. Let me know if you need any more information. Thanks, DA _________________________________________________________________ Watch ?Cause Effect,? a show about real people making a real difference. http://im.live.com/Messenger/IM/MTV/?source=text_watchcause -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/swiftiply-users/attachments/20080111/242a4dae/attachment.html From chrisangileri at yahoo.com Thu Jan 17 15:29:10 2008 From: chrisangileri at yahoo.com (Eire Angel) Date: Thu, 17 Jan 2008 12:29:10 -0800 (PST) Subject: [Swiftiply-users] mongrel version Message-ID: <535357.69679.qm@web53407.mail.re2.yahoo.com> has there been any testing with evented mongrels and mongrel 1.1.3 seems to work for me but i was wondering if there would be any issues ? Chris --------------------------------- Never miss a thing. Make Yahoo your homepage. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/swiftiply-users/attachments/20080117/348bd327/attachment.html From swiftiply at dusty.name Thu Jan 24 10:09:41 2008 From: swiftiply at dusty.name (Dusty Doris) Date: Thu, 24 Jan 2008 10:09:41 -0500 Subject: [Swiftiply-users] swiftiply 0.6.1.1 bug? Message-ID: I have just installed swiftiply 0.6.1.1 and I'm testing it out against a custom mongrel handler. When I send a request to the swiftiply instance that does not contain a valid handler, the swiftiplied mongrel exits instead of returning a 404. $ cat swiftiply.yml cluster_address: 0.0.0.0 cluster_port: 2222 daemonize: false epoll: true epoll_descriptors: 20000 timeout: 3 map: - incoming: localhost default: true outgoing: 127.0.0.1:30000 redeployable: true redeployable: 114168 $ cat test.rb require "rubygems" require "swiftcore/swiftiplied_mongrel" class HiHandler < Mongrel::HttpHandler def process(request,response) response.start(200) do |head, out| head["Content-Type"] = "text/plain" out.write "hi" end end end server = Mongrel::HttpServer.new("127.0.0.1",30000) server.register("/hi", HiHandler.new) server.run.join When I go to: http://127.0.0.1:2222/hi It works fine When I go to: http://127.0.0.1:2222/bad I get $ ruby test.rb /Library/Ruby/Gems/1.8/gems/swiftiply-0.6.1.1/src/swiftcore/swiftiplied_mongrel.rb:159:in `process_http_request': undefined method `status=' for nil:NilClass (NoMethodError) from test.rb:15:in `join' from test.rb:15 Looking at that line, it appears that the request object is not being created. The line in question, has ##### above it. -------------- snip def process_http_request(params,linebuffer,client) if not params[Const::REQUEST_PATH] uri = URI.parse(params[Const::REQUEST_URI]) params[Const::REQUEST_PATH] = uri.request_uri end raise "No REQUEST PATH" if not params[Const::REQUEST_PATH] script_name, path_info, handlers = @classifier.resolve(params[Const::REQUEST_PATH]) if handlers notifiers = handlers.select { |h| h.request_notify } request = HttpRequest.new(params, linebuffer, notifiers) # request is good so far, continue processing the response response = HttpResponse.new(client) # Process each handler in registered order until we run out or one finalizes the response. dispatch_to_handlers(handlers,request,response) # And finally, if nobody closed the response off, we finalize it. unless response.done response.finished end else # Didn't find it, return a stock 404 response. # This code is changed from the Mongrel behavior because a content-length # header MUST accompany all HTTP responses that go into a swiftiply # keepalive connection, so just use the Response object to construct the # 404 response. ##### response.status = 404 response.body = "#{params[Const::REQUEST_PATH]} not found" response.finished end end ------------------- So, if I add this to the top of that else section before the response actions are called. response = HttpResponse.new(client) Then I get this error instead. $ ruby test.rb /Library/Ruby/Gems/1.8/gems/mongrel-1.1.3/lib/mongrel/http_response.rb:102:in `send_body': undefined method `rewind' for "/bad not found":String (NoMethodError) from test.rb:15:in `join' from test.rb:15 Any ideas? Thanks Dusty Doris From B.Candler at pobox.com Fri Jan 25 03:27:19 2008 From: B.Candler at pobox.com (Brian Candler) Date: Fri, 25 Jan 2008 08:27:19 +0000 Subject: [Swiftiply-users] swiftiply 0.6.1.1 bug? In-Reply-To: References: Message-ID: <20080125082718.GA20219@uk.tiscali.com> On Thu, Jan 24, 2008 at 10:09:41AM -0500, Dusty Doris wrote: > I have just installed swiftiply 0.6.1.1 and I'm testing it out against > a custom mongrel handler. When I send a request to the swiftiply > instance that does not contain a valid handler, the swiftiplied > mongrel exits instead of returning a 404. ... > $ ruby test.rb > /Library/Ruby/Gems/1.8/gems/swiftiply-0.6.1.1/src/swiftcore/swiftiplied_mongrel.rb:159:in > `process_http_request': undefined method `status=' for nil:NilClass > (NoMethodError) > from test.rb:15:in `join' > from test.rb:15 Looks to be the same bug as I documented here in October: http://rubyforge.org/tracker/index.php?func=detail&aid=14949&group_id=3637&atid=14008 (FYI, this prompted me to change from swiftiply to pen. I decided that a "standard" solution - in particular running an unpatched mongrel and no eventmachine - was more likely not to have hidden bugs like this) Regards, Brian.