From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS33070 50.56.128.0/17 X-Spam-Status: No, score=0.0 required=3.0 tests=AWL,MSGID_FROM_MTA_HEADER, TVD_RCVD_IP shortcircuit=no autolearn=unavailable version=3.3.2 Path: news.gmane.org!not-for-mail From: "Lin Jen-Shin (godfat)" Newsgroups: gmane.comp.lang.ruby.rainbows.general Subject: Re: [PATCH] close_connection_after_writing only if not deferred, as in cool.io Date: Fri, 28 Dec 2012 19:26:12 +0800 Message-ID: References: <20121218214538.GA12275@dcvr.yhbt.net> <20121218235954.GA14404@dcvr.yhbt.net> <20121228084337.GB19512@dcvr.yhbt.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1356694017 21398 80.91.229.3 (28 Dec 2012 11:26:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 28 Dec 2012 11:26:57 +0000 (UTC) To: "Rainbows! list" Original-X-From: rainbows-talk-bounces-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Fri Dec 28 12:27:12 2012 Return-path: Envelope-to: gclrrg-rainbows-talk@m.gmane.org X-Original-To: rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Delivered-To: rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=godfat.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=WONrQf9vj7LSKiAwfR4Fe2WHcbqE5GOvh5M5H+bcNoA=; b=wES0+BC64B7issyjau02Wf2sFOog46Gsxs1LAPQ9wb01Szm8aWgilvtiKcny3n/4X6 CwkrZV00UPUdWU1sROfGKLLW5kvqUmE/YCcSrJmoddwkoCPucUy1Gj8Aybo24YWLQ5cS +rqxEVIdpjG3sGPRNoIEqQ8qBtP4JJe2A2ddw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:x-gm-message-state; bh=WONrQf9vj7LSKiAwfR4Fe2WHcbqE5GOvh5M5H+bcNoA=; b=nf88Gl5Ox2a5MBwr/UOYovjlbRU8KBrsv6RW0Ae6h8dHdCKVarNKYMkurnUN/pMrEZ GILiA8d0BiYqfIbt0ivvOvwXi7i06xwB5/NUYRLCHeE21YUPAvNALzSxc7qWZLu4zRpT mHVTJljaia6BcShDMQ0tFOVQo/ET3d4JjjAuogXtH0HrICP7XC/3UsFsLin7eXFFmN03 wlMCu2LQymscylkAHUJJ38840qEq64MObTEsu1Ualj+q+i6HSZ6RF2ewiTPcthP3mk+R UzmkAUVVPg3lbKQdDtxgffXiWxQyJJUraUkJsTScGuxkdqHqwAuAsuUr/pIg0OC7DjPs zNrQ== In-Reply-To: <20121228084337.GB19512-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org> X-Gm-Message-State: ALoCoQmfFtWhN8jNom5ZC9qHHFB5HQEdQvHA9Xc/sJrohc0HV5t2r90jaEmxuPctreZHmrITz2fK X-BeenThere: rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: rainbows-talk-bounces-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Errors-To: rainbows-talk-bounces-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Xref: news.gmane.org gmane.comp.lang.ruby.rainbows.general:428 Archived-At: Received: from 50-56-192-79.static.cloud-ips.com ([50.56.192.79] helo=rubyforge.org) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ToY5h-0002bq-Ct for gclrrg-rainbows-talk@m.gmane.org; Fri, 28 Dec 2012 12:27:05 +0100 Received: from localhost.localdomain (localhost [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 7E6012E097; Fri, 28 Dec 2012 11:26:50 +0000 (UTC) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com [209.85.215.41]) by rubyforge.org (Postfix) with ESMTP id 252D82E076 for ; Fri, 28 Dec 2012 11:26:44 +0000 (UTC) Received: by mail-la0-f41.google.com with SMTP id em20so655126lab.28 for ; Fri, 28 Dec 2012 03:26:43 -0800 (PST) Received: by 10.112.43.161 with SMTP id x1mr13442344lbl.32.1356694002900; Fri, 28 Dec 2012 03:26:42 -0800 (PST) Received: by 10.114.2.240 with HTTP; Fri, 28 Dec 2012 03:26:12 -0800 (PST) On Fri, Dec 28, 2012 at 4:43 PM, Eric Wong wrote: > I definitely don't want to rely on GNU-isms in shell scripts, > it should rely on POSIX behavior. > > It /should/ work on *BSD, I'll try again on FreeBSD tomorrow. I got managed to get them all passed now :D The problem is at `wc`. On my mac, wc would print some leading spaces even if you use `wc -c < random_blob`. $ echo 's' | wc -c 2 After using coreutils from GNU or use sed to strip the spaces, everything passed, except for the one for Apache ab. I've heard that ab is broken on mac, and after install ab from: https://github.com/Homebrew/homebrew-dupes/pull/102 Tests using ab are all passed too. ref: http://simon.heimlicher.com/articles/2012/07/08/fix-apache-bench-ab-on-os-x-lion Nothing to do with grep. Also, after confirming all tests are fine, the only test which cannot pass for eventmachine with threads is: "send big pipelined identity requests" As you mentioned before, the issue is that there is no easy way to disable a connection and enable it later on? I tried `pause' and `resume', but it doesn't seem to work correctly? Or I might have done something wrong or missed something. If I took out this line to make Rainbows! buffer everything, it would also work. @_io.shutdown(Socket::SHUT_RD) if @buf.size > 0x1c000 But I guess we shouldn't really buffer them in Ruby. I am still trying to solve this :/ You can find my working copy here: https://github.com/godfat/rainbows/pull/2/files I don't paste it inline here because it's large and I guess we should make all tests pass. Or we could skip that test for this model? Another concern is that, the most straightforward implementation would be subclass Rainbows::EventMachine::Client to make it app_call in a thread. But there's em_client_class option which users might provide their own eventmachine connection. If I did this in a client class, then users who provide their own client class won't really respect the threads, making using EventMachine or EventMachineThreadSpawn basically the same. I think this is somehow unexpected. But then I realized using another option for threads or not really complicates the original implementation, this is not what I really want either. I am not sure if there's a perfect solution for this, so I just concentrate on passing all tests first... _______________________________________________ Rainbows! mailing list - rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org http://rubyforge.org/mailman/listinfo/rainbows-talk Do not quote signatures (like this one) or top post when replying