Rainbows! Rack HTTP server user/dev discussion
 help / Atom feed
From: Eric Wong <normalperson-rMlxZR9MS24@public.gmane.org>
To: Rainbows! list <rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org>
Subject: Re: [PATCH] close_connection_after_writing only if not deferred, as in cool.io
Date: Sat, 29 Dec 2012 13:26:01 +0000
Message-ID: <20121229132601.GA16997@dcvr.yhbt.net> (raw)
In-Reply-To: <CAA2_N1tCYbJjh_NvdVOQzJ5hvdv5NYnBM+VhP105uRvCzbnF_A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

"Lin Jen-Shin (godfat)" <godfat-hOE/xeEBYYIdnm+yROfE0A@public.gmane.org> wrote:
> On Fri, Dec 28, 2012 at 4:43 PM, Eric Wong <normalperson-rMlxZR9MS24@public.gmane.org> 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

Ah, probably good to add a byte_count() function to test-lib.sh
to get around this...  FreeBSD 9.0 does this, too.
I didn't manage to work more on FreeBSD, got distracted by bugs
in other projects...

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

I think that was another issue I had with the EM thread
implementation I tried...

> 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?

Tests for features are fine to skip, but being open to such a
trivial DoS is not fine...  Perhaps disable keepalive support
entirely?  (you'd have to disable a lot of tests, perhaps
like StreamResponseEpoll :x)

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

That was for Cramp, I can't remember exactly how it worked...

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

They'd have to pick the threaded concurrency model.  Maybe
more Ruby code is thread-safe nowadays...

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

Yes, Rainbows! already has so many options it's hard to keep
things straight :x

I believe EM is one of the concurrency options people actually use in
Rainbows!, so it's important to not break it.  I don't mind copy+pasting
first and eventually factoring out the common parts if possible.
_______________________________________________
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


      parent reply index

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAA2_N1tHbvs=J--dPZLnq6_owEx3JJZbFoRzjFKcCLBONW=iGA@mail.gmail.com>
     [not found] ` <CAA2_N1s+SefHd7Dotw53+5b=-EeBt_O5Q-LmoKuUy65jZiZ+tA@mail.gmail.com>
     [not found]   ` <CAA2_N1s+SefHd7Dotw53+5b=-EeBt_O5Q-LmoKuUy65jZiZ+tA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-12-18 20:36     ` Lin Jen-Shin (godfat)
     [not found]       ` <CAA2_N1scEcW3J=4dmUVvd+UgLwuayqkpfjNfVGLCJw-dXm9_cA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-12-18 21:45         ` Eric Wong
     [not found]           ` <20121218214538.GA12275-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org>
2012-12-18 22:20             ` Lin Jen-Shin (godfat)
     [not found]               ` <CAA2_N1ur-dxw4i9dvMhTNAcskJe+N=4hU2Yuq341TxvJ2KE4kw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-12-18 23:59                 ` Eric Wong
     [not found]                   ` <20121218235954.GA14404-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org>
2012-12-28  4:45                     ` Lin Jen-Shin (godfat)
     [not found]                       ` <CAA2_N1ujCb8Yt4FGJNaTN0FdSk6g_iqL5N747Vcxt5etp9RnMw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-12-28  8:43                         ` Eric Wong
     [not found]                           ` <20121228084337.GB19512-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org>
2012-12-28 11:26                             ` Lin Jen-Shin (godfat)
     [not found]                               ` <CAA2_N1tCYbJjh_NvdVOQzJ5hvdv5NYnBM+VhP105uRvCzbnF_A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-12-29 13:26                                 ` Eric Wong [this message]

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://bogomips.org/rainbows/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121229132601.GA16997@dcvr.yhbt.net \
    --to=normalperson-rmlxzr9ms24@public.gmane.org \
    --cc=rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Rainbows! Rack HTTP server user/dev discussion

Archives are clonable:
	git clone --mirror https://bogomips.org/rainbows-public
	git clone --mirror http://ou63pmih66umazou.onion/rainbows-public

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.lang.ruby.rainbows
	nntp://ou63pmih66umazou.onion/inbox.comp.lang.ruby.rainbows

 note: .onion URLs require Tor: https://www.torproject.org/
       or Tor2web: https://www.tor2web.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox