unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [ANN] unicorn 5.3.1 - Rack HTTP server for fast clients and Unix
  @ 2017-10-03 19:15  4% ` Eric Wong
  0 siblings, 0 replies; 4+ results
From: Eric Wong @ 2017-10-03 19:15 UTC (permalink / raw)
  To: ruby-talk, unicorn-public; +Cc: azrlew, pere.joan

unicorn is an HTTP server for Rack applications designed to only serve
fast clients on low-latency, high-bandwidth connections and take
advantage of features in Unix/Unix-like kernels.  Slow clients should
only be served by placing a reverse proxy capable of fully buffering
both the the request and response in between unicorn and slow clients.

* https://bogomips.org/unicorn/
* public list: unicorn-public@bogomips.org
* mail archives: https://bogomips.org/unicorn-public/
* git clone git://bogomips.org/unicorn.git
* https://bogomips.org/unicorn/NEWS.atom.xml
* nntp://news.public-inbox.org/inbox.comp.lang.ruby.unicorn

Changes:

unicorn 5.3.1

This release fixes an occasional GC problem introduced in v5.3.0
to reduce global variable overhead (commit 979ebcf91705709b)

Thanks to Xuanzhong Wei for the patch which lead to this release:

https://bogomips.org/unicorn-public/20171003182054.76392-1-azrlew@gmail.com/T/#u
https://bogomips.org/unicorn-public/20171003145718.30404-1-azrlew@gmail.com/T/#u

Xuanzhong Wei (1):
  fix GC issue on rb_global_variable array

^ permalink raw reply	[relevance 4%]

* Re: [PATCH] fix GC issue on rb_global_variable array
  2017-10-03 17:47  7% ` Eric Wong
@ 2017-10-03 18:26  7%   ` Xuanzhong Wei
  0 siblings, 0 replies; 4+ results
From: Xuanzhong Wei @ 2017-10-03 18:26 UTC (permalink / raw)
  To: e; +Cc: azrlew, unicorn-public

Really appreciate your help!

^ permalink raw reply	[relevance 7%]

* Re: [PATCH] fix GC issue on rb_global_variable array
  2017-10-03 14:57  7% [PATCH] fix GC issue on rb_global_variable array Xuanzhong Wei
@ 2017-10-03 17:47  7% ` Eric Wong
  2017-10-03 18:26  7%   ` Xuanzhong Wei
  0 siblings, 1 reply; 4+ results
From: Eric Wong @ 2017-10-03 17:47 UTC (permalink / raw)
  To: Xuanzhong Wei; +Cc: unicorn-public

Xuanzhong Wei <azrlew@gmail.com> wrote:
> diff --git a/ext/unicorn_http/unicorn_http.rl b/ext/unicorn_http/unicorn_http.rl
> index 6fc3498..357440b 100644
> --- a/ext/unicorn_http/unicorn_http.rl
> +++ b/ext/unicorn_http/unicorn_http.rl
> @@ -921,6 +921,7 @@ void Init_unicorn_http(void)
>    VALUE mUnicorn, cHttpParser;
>  
>    mark_ary = rb_ary_new();
> +  rb_global_variable(&mark_ary);
>    mUnicorn = rb_define_module("Unicorn");
>    cHttpParser = rb_define_class_under(mUnicorn, "HttpParser", rb_cObject);
>    eHttpParserError =
> @@ -976,7 +977,6 @@ void Init_unicorn_http(void)
>    init_unicorn_httpdate(mark_ary);
>  
>    OBJ_FREEZE(mark_ary);
> -  rb_global_variable(&mark_ary);

Yes, the compiler should be free to drop mark_ary by here, since
it only needs its address (not the actual VALUE) and OBJ_FREEZE
only accesses the RBasic->flags field if init_unicorn_httpdate
gets inlined.

Pushed to master as e85de00a3065461f6fac466276d915b809f40c7c.
Also, created a 5.3-stable branch for 5.3.1 (to be released today)
@ git://bogomips.org/unicorn

^ permalink raw reply	[relevance 7%]

* [PATCH] fix GC issue on rb_global_variable array
@ 2017-10-03 14:57  7% Xuanzhong Wei
  2017-10-03 17:47  7% ` Eric Wong
  0 siblings, 1 reply; 4+ results
From: Xuanzhong Wei @ 2017-10-03 14:57 UTC (permalink / raw)
  To: unicorn-public; +Cc: Xuanzhong Wei

We need to add the array to ruby's global_list right after created it;
otherwise it probably gets GCed.
---
 ext/unicorn_http/unicorn_http.rl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ext/unicorn_http/unicorn_http.rl b/ext/unicorn_http/unicorn_http.rl
index 6fc3498..357440b 100644
--- a/ext/unicorn_http/unicorn_http.rl
+++ b/ext/unicorn_http/unicorn_http.rl
@@ -921,6 +921,7 @@ void Init_unicorn_http(void)
   VALUE mUnicorn, cHttpParser;
 
   mark_ary = rb_ary_new();
+  rb_global_variable(&mark_ary);
   mUnicorn = rb_define_module("Unicorn");
   cHttpParser = rb_define_class_under(mUnicorn, "HttpParser", rb_cObject);
   eHttpParserError =
@@ -976,7 +977,6 @@ void Init_unicorn_http(void)
   init_unicorn_httpdate(mark_ary);
 
   OBJ_FREEZE(mark_ary);
-  rb_global_variable(&mark_ary);
 
 #ifndef HAVE_RB_HASH_CLEAR
   id_clear = rb_intern("clear");
-- 
2.14.1


^ permalink raw reply related	[relevance 7%]

Results 1-4 of 4 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2017-04-01  8:08     [ANN] unicorn 5.3.0 - Rack HTTP server for fast clients and Unix Eric Wong
2017-10-03 19:15  4% ` [ANN] unicorn 5.3.1 " Eric Wong
2017-10-03 14:57  7% [PATCH] fix GC issue on rb_global_variable array Xuanzhong Wei
2017-10-03 17:47  7% ` Eric Wong
2017-10-03 18:26  7%   ` Xuanzhong Wei

Code repositories for project(s) associated with this public inbox

	https://yhbt.net/unicorn.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).