unicorn 5.2.0 → 5.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 75575863e5a09d4ac351269084628052c8ec554c
4
- data.tar.gz: 5f7fc37e895b8982c3076fc56642ec90d8632d46
3
+ metadata.gz: b81793b7bf9db70d6d014404f3d109cbe8528951
4
+ data.tar.gz: 80747270f849455aa5f6df45bd720452b366a681
5
5
  SHA512:
6
- metadata.gz: 85c7d9f5d6c3056508758a7375809d477ee7e640167470711e4fda53e7f6c52ea6688e708fde80af5e54262dcdd218c0ef9fc966221c1e30762b0bdabf5c41fb
7
- data.tar.gz: 1829ab9e474b1932617c97e37d6efa1075c1c147f8aa726777478741b5ae9106a163194647e03ff8d73786017dd2142afad8804d16625fde48876e10dc0e3a30
6
+ metadata.gz: 42b0045616f1243a945a24bf2c4f46f587655ecd24669f5c59b98aa25bef2e6b4a1ff47d580d41a9ad76f2490b09d5433229135cec52c7b7e2293c3086399949
7
+ data.tar.gz: 9bb45e6d41a3d1a8888b64f127269e67d3101f1ba0d637723820f5a881cc2754e3defcf83e9c98d41f4f25a3a95837be6cbef0538128717aac189ecac6fc9c5a
data/.manifest CHANGED
@@ -140,6 +140,7 @@ test/benchmark/stack.ru
140
140
  test/exec/README
141
141
  test/exec/test_exec.rb
142
142
  test/test_helper.rb
143
+ test/unit/test_ccc.rb
143
144
  test/unit/test_configurator.rb
144
145
  test/unit/test_droplet.rb
145
146
  test/unit/test_http_parser.rb
data/.olddoc.yml CHANGED
@@ -12,7 +12,6 @@ noindex:
12
12
  - TODO
13
13
  - unicorn_rails_1
14
14
  public_email: unicorn-public@bogomips.org
15
- private_email: unicorn@bogomips.org
16
15
  nntp_url:
17
16
  - nntp://news.public-inbox.org/inbox.comp.lang.ruby.unicorn
18
17
  - nntp://news.gmane.org/gmane.comp.lang.ruby.unicorn.general
data/GIT-VERSION-FILE CHANGED
@@ -1 +1 @@
1
- GIT_VERSION = 5.2.0
1
+ GIT_VERSION = 5.3.0
data/GIT-VERSION-GEN CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
- DEF_VER = "v5.2.0"
2
+ DEF_VER = "v5.3.0"
3
3
  CONSTANT = "Unicorn::Const::UNICORN_VERSION"
4
4
  RVF = "lib/unicorn/version.rb"
5
5
  GVF = "GIT-VERSION-FILE"
data/HACKING CHANGED
@@ -104,7 +104,6 @@ don't email the git mailing list or maintainer with Unicorn patches :)
104
104
 
105
105
  In order to build the gem, you must install the following components:
106
106
 
107
- * olddoc (RubyGem)
108
107
  * pandoc
109
108
 
110
109
  You can build the Unicorn gem with the following command:
data/ISSUES CHANGED
@@ -9,14 +9,16 @@ submit patches and/or obtain support after you have searched the
9
9
  * Cc: all participants in a thread or commit, as subscription is optional
10
10
  * Do not {top post}[http://catb.org/jargon/html/T/top-post.html] in replies
11
11
  * Quote as little as possible of the message you're replying to
12
- * Do not send HTML mail or images, it will be flagged as spam
13
- * Anonymous and pseudonymous messages will always be welcome.
12
+ * Do not send HTML mail or images,
13
+ they hurt reader privacy and will be flagged as spam
14
+ * Anonymous and pseudonymous messages will ALWAYS be welcome
14
15
  * The email submission port (587) is enabled on the bogomips.org MX:
15
16
  https://bogomips.org/unicorn-public/20141004232241.GA23908@dcvr.yhbt.net/t/
16
17
 
17
18
  If your issue is of a sensitive nature or you're just shy in public,
18
- then feel free to email us privately at mailto:unicorn@bogomips.org
19
- instead and your issue will be handled discreetly.
19
+ use anonymity tools such as Tor or Mixmaster; and rely on the public
20
+ mail archives for responses. Be sure to scrub sensitive log messages
21
+ and such.
20
22
 
21
23
  If you don't get a response within a few days, we may have forgotten
22
24
  about it so feel free to ask again.
@@ -64,14 +66,14 @@ document distributed with git) on guidelines for patch submission.
64
66
  == Contact Info
65
67
 
66
68
  * public: mailto:unicorn-public@bogomips.org
67
- * private: mailto:unicorn@bogomips.org
68
69
  * nntp://news.gmane.org/gmane.comp.lang.ruby.unicorn.general
69
70
  * nntp://news.public-inbox.org/inbox.comp.lang.ruby.unicorn
70
71
  * https://bogomips.org/unicorn-public/
72
+ * http://ou63pmih66umazou.onion/unicorn-public/
71
73
 
72
74
  Mailing list subscription is optional, so Cc: all participants.
73
75
 
74
- You can follow along via NNTP:
76
+ You can follow along via NNTP (read-only):
75
77
 
76
78
  nntp://news.public-inbox.org/inbox.comp.lang.ruby.unicorn
77
79
  nntp://news.gmane.org/gmane.comp.lang.ruby.unicorn.general
@@ -79,6 +81,7 @@ You can follow along via NNTP:
79
81
  Or Atom feeds:
80
82
 
81
83
  https://bogomips.org/unicorn-public/new.atom
84
+ http://ou63pmih66umazou.onion/unicorn-public/new.atom
82
85
 
83
86
  The HTML archives at https://bogomips.org/unicorn-public/
84
87
  also has links to per-thread Atom feeds and downloadable
@@ -88,3 +91,6 @@ You may optionally subscribe via plain-text email:
88
91
 
89
92
  mailto:unicorn-public+subscribe@bogomips.org
90
93
  (and confirming the auto-reply)
94
+
95
+ Just keep in mind we suck at delivering email, so using NNTP,
96
+ or Atom feeds might be a better bet...
data/LATEST CHANGED
@@ -1,37 +1,83 @@
1
- === unicorn 5.1.0 - rack is optional, again / 2016-04-01 00:35 UTC
1
+ === unicorn 5.3.0.pre1 / 2017-03-24 00:25 UTC
2
2
 
3
- Note: no code changes since 5.1.0.pre1 from January.^WNo, wait,
4
- last minute performance improvement added today. See below.
3
+ A largish release with several new features.
5
4
 
6
- The big change is rack is not required (but still recommended).
7
- Applications are expected to depend on rack on their own so they can
8
- specify the version of rack they prefer without unicorn pulling
9
- in a newer, potentially incompatible version.
5
+ Simon Eskildsen contributed heavily using TCP_INFO under Linux
6
+ to implement the (now 5 year old) check_client_connection feature:
10
7
 
11
- unicorn will always attempt to work with multiple versions of rack
12
- as practical.
8
+ https://bogomips.org/unicorn/Unicorn/Configurator.html#method-i-check_client_connection
9
+ https://bogomips.org/unicorn-public/?q=s:check_client_connection&d:..20170324&x=t
13
10
 
14
- The HTTP parser also switched to using the TypedData C-API for
15
- extra type safety and memory usage accounting support in the
16
- 'objspace' extension.
11
+ This also led to FreeBSD and OpenBSD portability improvements in
12
+ one of our dependencies, raindrops:
17
13
 
18
- Thanks to Adam Duke to bringing the rack change to our attention
19
- and Aaron Patterson for helping with the matter.
14
+ https://bogomips.org/raindrops-public/20170323024829.GA5190@dcvr/T/#u
20
15
 
21
- Last minute change: we now support the new leftpad() syscall under
22
- Linux for major performance and security improvement:
16
+ Jeremy Evans contributed several new features. First he
17
+ implemented after_worker_exit to aid debugging:
23
18
 
24
- http://mid.gmane.org/1459463613-32473-1-git-send-email-richard@nod.at
19
+ https://bogomips.org/unicorn/Unicorn/Configurator.html#method-i-after_worker_exit
20
+ https://bogomips.org/unicorn-public/?q=s:after_worker_exit&d:..20170324&x=t#t
25
21
 
26
- 8^H9 changes since 5.0.1:
22
+ And then security-related features to isolate workers. Workers
23
+ may now chroot to drop access to the master filesystem, and the
24
+ new after_worker_ready configuration hook now exists to aid with
25
+ chroot support in workers:
27
26
 
28
- http: TypedData C-API conversion
29
- various documentation updates
30
- doc: bump olddoc to ~> 1.2 for extra NNTP URL
31
- rack is optional at runtime, required for dev
32
- doc update for ClientShutdown exceptions class
33
- unicorn 5.1.0.pre1 - rack is optional, again
34
- doc: reference --keep-file-descriptors for "bundle exec"
35
- doc: further trimming to reduce noise
36
- use leftpad Linux syscall for speed!
27
+ https://bogomips.org/unicorn/Unicorn/Configurator.html#method-i-after_worker_ready
28
+ https://bogomips.org/unicorn/Unicorn/Worker.html#method-i-user
29
+ https://bogomips.org/unicorn-public/?q=s:after_worker_ready&d:..20170324&x=t#t
30
+ https://bogomips.org/unicorn-public/?q=s:chroot&d:..20170324&x=t#t
31
+
32
+ Additionally, workers may run in a completely different VM space
33
+ (nullifying preload_app and any CoW savings) with the new
34
+ worker_exec option:
35
+
36
+ https://bogomips.org/unicorn/Unicorn/Configurator.html#method-i-worker_exec
37
+ https://bogomips.org/unicorn-public/?q=s:worker_exec&d:..20170324&x=t#t
38
+
39
+ There are also several improvements to FreeBSD and OpenBSD
40
+ support with the addition of these features.
41
+
42
+ 34 changes since 5.2.0 (2016-10-31):
43
+
44
+ Eric Wong (27):
45
+ drop rb_str_set_len compatibility replacement
46
+ TUNING: document THP caveat for Linux users
47
+ tee_input: simplify condition for IO#write
48
+ remove response_start_sent
49
+ http_request: freeze constant strings passed IO#write
50
+ Revert "remove response_start_sent"
51
+ t/t0012-reload-empty-config.sh: access ivars directly if needed
52
+ t0011-active-unix-socket.sh: fix race condition in test
53
+ new test for check_client_connection
54
+ revert signature change to HttpServer#process_client
55
+ support "struct tcp_info" on non-Linux and Ruby 2.2+
56
+ unicorn_http: reduce rb_global_variable calls
57
+ oob_gc: rely on opt_aref_with optimization on Ruby 2.2+
58
+ http_request: reduce insn size for check_client_connection
59
+ freebsd: avoid EINVAL when setting accept filter
60
+ test-lib: expr(1) portability fix
61
+ tests: keep disabled tests defined
62
+ test_exec: SO_KEEPALIVE value only needs to be true
63
+ doc: fix links to raindrops project
64
+ http_request: support proposed Raindrops::TCP states on non-Linux
65
+ ISSUES: expand on mail archive info + subscription disclaimer
66
+ test_ccc: use a pipe to synchronize test
67
+ doc: remove private email support address
68
+ input: update documentation and hide internals.
69
+ http_server: initialize @pid ivar
70
+ gemspec: remove olddoc from build dependency
71
+ doc: add version annotations for new features
72
+
73
+ Jeremy Evans (6):
74
+ Add after_worker_exit configuration option
75
+ Fix code example in after_worker_exit documentation
76
+ Add support for chroot to Worker#user
77
+ Add after_worker_ready configuration option
78
+ Add worker_exec configuration option
79
+ Don't pass a block for fork when forking workers
80
+
81
+ Simon Eskildsen (1):
82
+ check_client_connection: use tcp state on linux
37
83
 
data/Links CHANGED
@@ -23,7 +23,7 @@ or services behind them.
23
23
  * {golden_brindle}[https://github.com/simonoff/golden_brindle] - tool to
24
24
  manage multiple unicorn instances/applications on a single server
25
25
 
26
- * {raindrops}[http://raindrops.bogomips.org/] - real-time stats for
26
+ * {raindrops}[https://bogomips.org/raindrops/] - real-time stats for
27
27
  preforking Rack servers
28
28
 
29
29
  * {UnXF}[https://bogomips.org/unxf/] Un-X-Forward* the Rack environment,
data/NEWS CHANGED
@@ -1,3 +1,116 @@
1
+ === unicorn 5.3.0.pre1 / 2017-03-24 00:25 UTC
2
+
3
+ A largish release with several new features.
4
+
5
+ Simon Eskildsen contributed heavily using TCP_INFO under Linux
6
+ to implement the (now 5 year old) check_client_connection feature:
7
+
8
+ https://bogomips.org/unicorn/Unicorn/Configurator.html#method-i-check_client_connection
9
+ https://bogomips.org/unicorn-public/?q=s:check_client_connection&d:..20170324&x=t
10
+
11
+ This also led to FreeBSD and OpenBSD portability improvements in
12
+ one of our dependencies, raindrops:
13
+
14
+ https://bogomips.org/raindrops-public/20170323024829.GA5190@dcvr/T/#u
15
+
16
+ Jeremy Evans contributed several new features. First he
17
+ implemented after_worker_exit to aid debugging:
18
+
19
+ https://bogomips.org/unicorn/Unicorn/Configurator.html#method-i-after_worker_exit
20
+ https://bogomips.org/unicorn-public/?q=s:after_worker_exit&d:..20170324&x=t#t
21
+
22
+ And then security-related features to isolate workers. Workers
23
+ may now chroot to drop access to the master filesystem, and the
24
+ new after_worker_ready configuration hook now exists to aid with
25
+ chroot support in workers:
26
+
27
+ https://bogomips.org/unicorn/Unicorn/Configurator.html#method-i-after_worker_ready
28
+ https://bogomips.org/unicorn/Unicorn/Worker.html#method-i-user
29
+ https://bogomips.org/unicorn-public/?q=s:after_worker_ready&d:..20170324&x=t#t
30
+ https://bogomips.org/unicorn-public/?q=s:chroot&d:..20170324&x=t#t
31
+
32
+ Additionally, workers may run in a completely different VM space
33
+ (nullifying preload_app and any CoW savings) with the new
34
+ worker_exec option:
35
+
36
+ https://bogomips.org/unicorn/Unicorn/Configurator.html#method-i-worker_exec
37
+ https://bogomips.org/unicorn-public/?q=s:worker_exec&d:..20170324&x=t#t
38
+
39
+ There are also several improvements to FreeBSD and OpenBSD
40
+ support with the addition of these features.
41
+
42
+ 34 changes since 5.2.0 (2016-10-31):
43
+
44
+ Eric Wong (27):
45
+ drop rb_str_set_len compatibility replacement
46
+ TUNING: document THP caveat for Linux users
47
+ tee_input: simplify condition for IO#write
48
+ remove response_start_sent
49
+ http_request: freeze constant strings passed IO#write
50
+ Revert "remove response_start_sent"
51
+ t/t0012-reload-empty-config.sh: access ivars directly if needed
52
+ t0011-active-unix-socket.sh: fix race condition in test
53
+ new test for check_client_connection
54
+ revert signature change to HttpServer#process_client
55
+ support "struct tcp_info" on non-Linux and Ruby 2.2+
56
+ unicorn_http: reduce rb_global_variable calls
57
+ oob_gc: rely on opt_aref_with optimization on Ruby 2.2+
58
+ http_request: reduce insn size for check_client_connection
59
+ freebsd: avoid EINVAL when setting accept filter
60
+ test-lib: expr(1) portability fix
61
+ tests: keep disabled tests defined
62
+ test_exec: SO_KEEPALIVE value only needs to be true
63
+ doc: fix links to raindrops project
64
+ http_request: support proposed Raindrops::TCP states on non-Linux
65
+ ISSUES: expand on mail archive info + subscription disclaimer
66
+ test_ccc: use a pipe to synchronize test
67
+ doc: remove private email support address
68
+ input: update documentation and hide internals.
69
+ http_server: initialize @pid ivar
70
+ gemspec: remove olddoc from build dependency
71
+ doc: add version annotations for new features
72
+
73
+ Jeremy Evans (6):
74
+ Add after_worker_exit configuration option
75
+ Fix code example in after_worker_exit documentation
76
+ Add support for chroot to Worker#user
77
+ Add after_worker_ready configuration option
78
+ Add worker_exec configuration option
79
+ Don't pass a block for fork when forking workers
80
+
81
+ Simon Eskildsen (1):
82
+ check_client_connection: use tcp state on linux
83
+
84
+ === unicorn 5.2.0 / 2016-10-31 20:00 UTC
85
+
86
+ Most notably, this release allows us to support requests with
87
+ lines delimited by LF-only, as opposed to the standard CRLF
88
+ pair and allowed by RFC 2616 sec 19.3.
89
+
90
+ Thanks to Mishael A Sibiryakov for the explanation and change:
91
+
92
+ https://bogomips.org/unicorn-public/1476954332.1736.156.camel@junki.org/
93
+
94
+ Thanks to Let's Encrypt, the website also moves to HTTPS
95
+ <https://bogomips.org/unicorn/> to improve reader privacy. The
96
+ "unicorn.bogomips.org" subdomain will be retired soon to reduce
97
+ subjectAltName bloat and speed up certificate renewals.
98
+
99
+ There's also the usual round of documentation and example
100
+ updates, too.
101
+
102
+ Eric Wong (7):
103
+ examples/init.sh: update to reduce upgrade raciness
104
+ doc: systemd should only kill master in example
105
+ examples/logrotate.conf: update example for systemd
106
+ doc: update gmane URLs to point to our own archives
107
+ relocate website to https://bogomips.org/unicorn/
108
+ TODO: remove Rack 2.x item
109
+ build: "install-gem" target avoids network
110
+
111
+ Mishael A Sibiryakov (1):
112
+ Add some tolerance (RFC2616 sec. 19.3)
113
+
1
114
  === unicorn 5.1.0 - rack is optional, again / 2016-04-01 00:35 UTC
2
115
 
3
116
  Note: no code changes since 5.1.0.pre1 from January.^WNo, wait,
data/TUNING CHANGED
@@ -72,10 +72,28 @@ See Unicorn::Configurator for details on the config file format.
72
72
  have them unbuffered (File#sync = true) or they are
73
73
  record(line)-buffered in userspace before any writes.
74
74
 
75
- == Kernel Parameters (Linux sysctl)
75
+ == Kernel Parameters (Linux sysctl and sysfs)
76
76
 
77
77
  WARNING: Do not change system parameters unless you know what you're doing!
78
78
 
79
+ * Transparent hugepages (THP) improves performance in many cases,
80
+ but can also increase memory use when relying on a
81
+ copy-on-write(CoW)-friendly GC (Ruby 2.0+) with "preload_app true".
82
+ CoW operates at the page level, so writing to a huge page would
83
+ trigger a 2 MB copy (x86-64), as opposed to a 4 KB copy on a
84
+ regular (non-huge) page.
85
+
86
+ Consider only allowing THP to be used when it is requested via the
87
+ madvise(2) syscall:
88
+
89
+ echo madvise >/sys/kernel/mm/transparent_hugepage/enabled
90
+
91
+ Or disabling it system-wide, via "never".
92
+
93
+ n.b. "page" in this context only applies to the OS kernel,
94
+ Ruby GC implementations also use this term for the same concept
95
+ in a way that is agnostic to the OS.
96
+
79
97
  * net.core.rmem_max and net.core.wmem_max can increase the allowed
80
98
  size of :rcvbuf and :sndbuf respectively. This is mostly only useful
81
99
  for UNIX domain sockets which do not have auto-tuning buffer sizes.
@@ -60,7 +60,7 @@ static struct common_field common_http_fields[] = {
60
60
  #define HTTP_PREFIX_LEN (sizeof(HTTP_PREFIX) - 1)
61
61
 
62
62
  /* this function is not performance-critical, called only at load time */
63
- static void init_common_fields(void)
63
+ static void init_common_fields(VALUE mark_ary)
64
64
  {
65
65
  int i;
66
66
  struct common_field *cf = common_http_fields;
@@ -77,7 +77,7 @@ static void init_common_fields(void)
77
77
  cf->value = rb_str_new(tmp, HTTP_PREFIX_LEN + cf->len);
78
78
  }
79
79
  cf->value = rb_obj_freeze(cf->value);
80
- rb_global_variable(&cf->value);
80
+ rb_ary_push(mark_ary, cf->value);
81
81
  }
82
82
  }
83
83
 
@@ -1,26 +1,6 @@
1
1
  #ifndef ext_help_h
2
2
  #define ext_help_h
3
3
 
4
- #ifndef RSTRING_PTR
5
- #define RSTRING_PTR(s) (RSTRING(s)->ptr)
6
- #endif /* !defined(RSTRING_PTR) */
7
- #ifndef RSTRING_LEN
8
- #define RSTRING_LEN(s) (RSTRING(s)->len)
9
- #endif /* !defined(RSTRING_LEN) */
10
-
11
- #ifndef HAVE_RB_STR_SET_LEN
12
- # ifdef RUBINIUS
13
- # error we should never get here with current Rubinius (1.x)
14
- # endif
15
- /* this is taken from Ruby 1.8.7, 1.8.6 may not have it */
16
- static void rb_18_str_set_len(VALUE str, long len)
17
- {
18
- RSTRING(str)->len = len;
19
- RSTRING(str)->ptr[len] = '\0';
20
- }
21
- # define rb_str_set_len(str,len) rb_18_str_set_len(str,len)
22
- #endif /* !defined(HAVE_RB_STR_SET_LEN) */
23
-
24
4
  /* not all Ruby implementations support frozen objects (Rubinius does not) */
25
5
  #if defined(OBJ_FROZEN)
26
6
  # define assert_frozen(f) assert(OBJ_FROZEN(f) && "unfrozen object")
@@ -4,7 +4,7 @@
4
4
  have_macro("SIZEOF_OFF_T", "ruby.h") or check_sizeof("off_t", "sys/types.h")
5
5
  have_macro("SIZEOF_SIZE_T", "ruby.h") or check_sizeof("size_t", "sys/types.h")
6
6
  have_macro("SIZEOF_LONG", "ruby.h") or check_sizeof("long", "sys/types.h")
7
- have_func("rb_str_set_len", "ruby.h")
7
+ have_func("rb_str_set_len", "ruby.h") or abort 'Ruby 1.9.3+ required'
8
8
  have_func("rb_hash_clear", "ruby.h") # Ruby 2.0+
9
9
  have_func("gmtime_r", "time.h")
10
10
 
@@ -56,7 +56,7 @@ NORETURN(static void parser_raise(VALUE klass, const char *));
56
56
  /** Defines global strings in the init method. */
57
57
  #define DEF_GLOBAL(N, val) do { \
58
58
  g_##N = rb_obj_freeze(rb_str_new(val, sizeof(val) - 1)); \
59
- rb_global_variable(&g_##N); \
59
+ rb_ary_push(mark_ary, g_##N); \
60
60
  } while (0)
61
61
 
62
62
  /* Defines the maximum allowed lengths for various input elements.*/
@@ -67,7 +67,7 @@ DEF_MAX_LENGTH(FRAGMENT, 1024); /* Don't know if this length is specified somewh
67
67
  DEF_MAX_LENGTH(REQUEST_PATH, 4096); /* common PATH_MAX on modern systems */
68
68
  DEF_MAX_LENGTH(QUERY_STRING, (1024 * 10));
69
69
 
70
- static void init_globals(void)
70
+ static void init_globals(VALUE mark_ary)
71
71
  {
72
72
  DEF_GLOBAL(rack_url_scheme, "rack.url_scheme");
73
73
  DEF_GLOBAL(request_method, "REQUEST_METHOD");