rainbows 0.91.1 → 0.92.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. data/.document +1 -1
  2. data/.gitignore +1 -0
  3. data/.manifest +13 -4
  4. data/ChangeLog +237 -219
  5. data/DEPLOY +13 -13
  6. data/Documentation/comparison.haml +1 -1
  7. data/GIT-VERSION-FILE +1 -1
  8. data/GIT-VERSION-GEN +1 -1
  9. data/GNUmakefile +18 -7
  10. data/NEWS +29 -0
  11. data/README +5 -4
  12. data/Rakefile +7 -0
  13. data/SIGNALS +5 -1
  14. data/TODO +2 -5
  15. data/config/.gitignore +1 -0
  16. data/config/isolate.rb +25 -0
  17. data/lib/rainbows/base.rb +32 -8
  18. data/lib/rainbows/const.rb +3 -2
  19. data/lib/rainbows/ev_core.rb +42 -2
  20. data/lib/rainbows/event_machine.rb +48 -5
  21. data/lib/rainbows/fiber/base.rb +4 -2
  22. data/lib/rainbows/fiber/rev.rb +1 -1
  23. data/lib/rainbows/http_response.rb +21 -20
  24. data/lib/rainbows/http_server.rb +13 -6
  25. data/lib/rainbows/max_body.rb +82 -0
  26. data/lib/rainbows/rev/deferred_response.rb +10 -11
  27. data/lib/rainbows/revactor.rb +38 -4
  28. data/lib/rainbows/tee_input.rb +17 -0
  29. data/lib/rainbows.rb +26 -2
  30. data/local.mk.sample +13 -23
  31. data/rainbows.gemspec +2 -2
  32. data/t/app_deferred.ru +23 -0
  33. data/t/async_examples/async_app.ru +8 -8
  34. data/t/rack-fiber_pool/app.ru +5 -0
  35. data/t/{t0100-rack-input-hammer.sh → t0100-rack-input-hammer-chunked.sh} +1 -1
  36. data/t/t0100-rack-input-hammer-content-length.sh +50 -0
  37. data/t/t0103-rack-input-limit.sh +60 -0
  38. data/t/t0104-rack-input-limit-tiny.sh +62 -0
  39. data/t/t0105-rack-input-limit-bigger.sh +105 -0
  40. data/t/t0401-em-async-tailer.sh +1 -1
  41. data/t/t0600-rack-fiber_pool.sh +49 -0
  42. data/t/t0700-app-deferred.sh +45 -0
  43. data/t/test-lib.sh +1 -0
  44. metadata +22 -10
  45. data/lib/rainbows/event_machine_defer.rb +0 -59
  46. data/lib/rainbows/revactor/tee_input.rb +0 -52
  47. data/t/simple-http_EventMachineDefer.ru +0 -11
data/ChangeLog CHANGED
@@ -1,349 +1,367 @@
1
- ChangeLog from git://git.bogomips.org/rainbows.git (v0.90.0..v0.91.1)
1
+ ChangeLog from git://git.bogomips.org/rainbows.git (v0.91.1..v0.92.0)
2
2
 
3
- commit 3d0558d7c80c63bab48eb561fdb7e3d580428b01
3
+ commit 0619e62285d25763ac1dee8a9aab18da7d39f80e
4
4
  Author: Eric Wong <normalperson@yhbt.net>
5
- Date: Mon Apr 19 13:47:29 2010 -0700
5
+ Date: Tue May 4 14:02:26 2010 -0700
6
6
 
7
- Rainbows! 0.91.1 - use a less-broken parser from Unicorn
7
+ Rainbows! 0.92.0 - inching towards the pot of gold
8
8
 
9
- This release fixes a denial-of-service vector for deployments
10
- exposed directly to untrusted clients.
9
+ Mostly internal cleanups and small improvements.
11
10
 
12
- The HTTP parser in Unicorn <= 0.97.0 would trip an assertion
13
- (killing the associated worker process) on invalid
14
- Content-Length headers instead of raising an exception. Since
15
- Rainbows! and Zbatery supports multiple clients per worker
16
- process, all clients connected to the worker process that hit
17
- the assertion would be aborted.
11
+ The only backwards incompatible change was the addition of the
12
+ "client_max_body_size" parameter to limit upload sizes to
13
+ prevent DoS. This defaults to one megabyte (same as nginx), so
14
+ any apps relying on the limit-less behavior of previous will
15
+ have to configure this in the Unicorn/Rainbows! config file:
18
16
 
19
- Deployments behind nginx are _not_ affected by this bug, as
20
- nginx will reject clients that send invalid Content-Length
21
- headers.
17
+ Rainbows! do
18
+ # nil for unlimited, or any number in bytes
19
+ client_max_body_size nil
20
+ end
22
21
 
23
- The status of deployments behind other HTTP-aware proxies is
24
- unknown. Deployments behind a non-HTTP-aware proxy (or no proxy
25
- at all) are certainly affected by this DoS.
22
+ The ThreadSpawn and ThreadPool models are now optimized for serving
23
+ large static files under Ruby 1.9 using IO.copy_stream[1].
26
24
 
27
- Users are strongly encouraged to upgrade as soon as possible,
28
- there are no other changes besides this bug fix from Rainbows!
29
- 0.91.0 nor Unicorn 0.97.0
25
+ The EventMachine model has always had optimized static file
26
+ serving (using EM::Connection#stream_file_data[2]).
30
27
 
31
- This bug affects all previously released versions of Rainbows!
32
- and Zbatery.
28
+ The EventMachine model (finally) gets conditionally deferred app
29
+ dispatch in a separate thread, as described by Ezra Zygmuntowicz
30
+ for Merb, Ebb and Thin[3].
31
+
32
+ [1] - http://euruko2008.csrug.cz/system/assets/documents/0000/0007/tanaka-IOcopy_stream-euruko2008.pdf
33
+ [2] - http://eventmachine.rubyforge.org/EventMachine/Connection.html#M000312
34
+ [3] - http://brainspl.at/articles/2008/04/18/deferred-requests-with-merb-ebb-and-thin
33
35
 
34
- commit d5d5658b927798c9f5c4aab9808c3c4386a51f14
36
+ commit ec50b892e5d3bc6f585780ebbbf071d489b2c3ae
35
37
  Author: Eric Wong <normalperson@yhbt.net>
36
- Date: Mon Mar 1 09:46:59 2010 +0000
38
+ Date: Tue May 4 14:56:44 2010 -0700
37
39
 
38
- Rainbows! 0.91.0 - Unicorn resync
39
-
40
- Unicorn 0.97.0 has a bunch of internal cleanups and small fixes
41
- and this is mainly to resync with those changes.
42
-
43
- keepalive_timeout now defaults to 5 seconds (from 2 seconds
44
- previous). This should help out clients on slower connections.
45
-
46
- Some small fixes and cleanups:
40
+ revactor: match IO behavior for readpartial wrapper
47
41
 
48
- * Rainbows::Fiber::IO objects may leak if a rare app uses them
49
- explicitly with FiberSpawn/FiberPool-only (not RevFiberSpawn)
50
-
51
- * quiet down ENOTCONN handling, there's nothing we can do about
52
- this error so we won't fill our logs with it.
42
+ IO#readpartial on zero bytes will always return an empty
43
+ string, so ensure the emulator for Revactor does that as
44
+ well.
53
45
 
54
- commit cf71e6cb13b371aee75c0443dee102ae76ca2ded
46
+ commit 3130edb35b3289149cbe7a36ce4e86406a39de35
55
47
  Author: Eric Wong <normalperson@yhbt.net>
56
- Date: Sun Feb 28 19:37:27 2010 -0800
48
+ Date: Tue May 4 14:27:06 2010 -0700
57
49
 
58
- rainbows: remove redundant check for $DEBUG
50
+ TODO: fix rdoc link
59
51
 
60
- commit 0339a494c6de90622d5c40df494e47ba9f986f3c
52
+ commit 47ab2c1e81251abc36ca83565292c3ecdfc33eeb
61
53
  Author: Eric Wong <normalperson@yhbt.net>
62
- Date: Sun Feb 28 19:30:29 2010 -0800
54
+ Date: Tue May 4 14:01:00 2010 -0700
63
55
 
64
- let Unicorn.builder parse switches in config.ru
56
+ tee_input: remember "encoding: binary" comment
65
57
 
66
- Less code for us is better
58
+ Even if it's just an empty file for now, it's critical in
59
+ case we ever add any code that returns user-visible strings
60
+ since Rack::Lint (and mere sanity) require binary encoding
61
+ for "rack.input".
67
62
 
68
- commit d7d1fd6b54501ece1a8777563c02de5b9297ed13
63
+ commit 53be61846ad12d1ae243e287f81608b43fbdd318
69
64
  Author: Eric Wong <normalperson@yhbt.net>
70
- Date: Sat Feb 27 20:03:20 2010 -0800
65
+ Date: Tue May 4 13:58:14 2010 -0700
71
66
 
72
- keepalive_timeout defaults to 5 seconds
73
-
74
- The previous 2 second default was not enough for folks on slow
75
- connections where our OS socket buffers would've masked the time
76
- it took to write out larger responses.
67
+ gemspec: bump Unicorn dependency
77
68
 
78
- ref: <20100219220904.GA11377@dcvr.yhbt.net>
69
+ We expect no API changes in Unicorn for a while
79
70
 
80
- commit 9d60e1931021faa52bee60e34913c656317f2698
71
+ commit 588af09a7fa0a950d711c3828c93a6a9414daacf
81
72
  Author: Eric Wong <normalperson@yhbt.net>
82
- Date: Sat Feb 27 19:04:40 2010 -0800
73
+ Date: Tue May 4 13:54:23 2010 -0700
83
74
 
84
- ev_core: avoid needless String#dup
85
-
86
- Just create an empty string instead and let Unicorn::HttpParser
87
- allocate it internally to whatever size is needed.
75
+ local.mk.sample: isolate needs the correct Rake
88
76
 
89
- commit 5221350c4c1e9a431fc06f14d3d8a695f8085ce5
77
+ commit 89841227d51977cc58e77b68309d4aef633fa61e
90
78
  Author: Eric Wong <normalperson@yhbt.net>
91
- Date: Sat Feb 27 18:26:08 2010 -0800
79
+ Date: Tue May 4 13:52:56 2010 -0700
92
80
 
93
- don't bother supporting platforms without FD_CLOEXEC
81
+ doc: DEPLOY - more strongly recommend Rainbows!-only
94
82
 
95
- No point in having extra code around for platforms we
96
- don't care about.
83
+ Paragraph ordering matters psychologically.
97
84
 
98
- commit e537f067c589c4e0b206878a42169c743d3e3ff2
85
+ commit 52b306c5cd47e34644f7ec5f7ab100855929b618
99
86
  Author: Eric Wong <normalperson@yhbt.net>
100
- Date: Sat Feb 27 18:21:08 2010 -0800
87
+ Date: Tue May 4 13:47:11 2010 -0700
101
88
 
102
- revactor: cleanups to avoid instance_eval
89
+ eventmachine: "rack.multithread" is always true when deferring
103
90
 
104
- instance_variable_{set,get} are faster, but equally ugly
91
+ Since deferred requests run in a separate thread, this affects
92
+ the root (non-deferred) thread as well since it may share
93
+ data with other threads.
105
94
 
106
- commit 2661b5dc2f95dc6a081980a59d999881d804c90d
95
+ commit e8cedc2584d23a8ab214ff96a973dc37344c2796
107
96
  Author: Eric Wong <normalperson@yhbt.net>
108
- Date: Sat Feb 27 18:07:41 2010 -0800
97
+ Date: Tue May 4 13:41:55 2010 -0700
109
98
 
110
- revactor: document our EMFILE handling strategy
99
+ drop EventMachineDefer concurrency model
100
+
101
+ Since we have conditional deferred execution in the regular
102
+ EventMachine concurrency model, we can drop this one.
103
+
104
+ This concurrency model never fully worked due to lack of
105
+ graceful shut downs, and was never promoted nor supported, either.
111
106
 
112
- commit 84c03d4019493edcd1c59e2816fbea08f3375c92
107
+ commit e61f0f4f901848e59b7b756224c765afde217a71
113
108
  Author: Eric Wong <normalperson@yhbt.net>
114
- Date: Sat Feb 27 17:58:16 2010 -0800
109
+ Date: Tue May 4 13:37:28 2010 -0700
115
110
 
116
- TCPSocket#peeraddr may raise ENOTCONN
111
+ SIGNALS: document app.deferred? caveat for graceful shutdown
117
112
 
118
- Since we deal with untrusted/non-local clients, those clients
119
- may disconnect at inopportune times and leave us with ENOTCONN
120
- when we try to call getpeername(2)
113
+ There doesn't appear to be a good/easy way to do this with
114
+ the built-in EventMachine thread pool :/
121
115
 
122
- commit 1e34a4f02e8f3743cf4d27117ccaf083a83b4d1f
116
+ commit def62fdc46f064ad61491021d46d223abe68100d
123
117
  Author: Eric Wong <normalperson@yhbt.net>
124
- Date: Fri Feb 26 03:22:44 2010 -0800
118
+ Date: Tue May 4 13:33:25 2010 -0700
125
119
 
126
- avoid leaks if app uses Rainbows::Fiber::IO
127
-
128
- For the very rare apps out there using Rainbows::Fiber::IO, the
129
- FiberSpawn and FiberPool (but not RevFiberSpawn) models could
130
- leak memory if the app-created Rainbows::Fiber::IO objects
131
- were dereferenced without being removed from the RD/WR hashes.
120
+ TODO: update EventMachine-related bits
132
121
 
133
- commit d6be7785ee6abf35001a0e7b655a6f64b7c7733f
122
+ commit 57909fb76dd0bcf95bed94ec41933ec85afda885
134
123
  Author: Eric Wong <normalperson@yhbt.net>
135
- Date: Fri Feb 26 03:04:18 2010 -0800
124
+ Date: Tue May 4 13:23:38 2010 -0700
136
125
 
137
- revactor/tee_input: sync w/ Unicorn::TeeInput struct-ification
126
+ eventmachine: add app.deferred?(env) support as middleware
138
127
 
139
- commit a5f4d11cdb9465b1ffa2892b3d84ee53b8962930 in unicorn.git
140
- switched all ivars to struct members for ease-of-hacking and
141
- object size.
128
+ Merb (and possibly other) frameworks that support conditionally
129
+ deferred app dispatch can now use it just like Ebb and Thin.
130
+
131
+ http://brainspl.at/articles/2008/04/18/deferred-requests-with-merb-ebb-and-thin
142
132
 
143
- commit a5064bc0bb549ca60e3e4d5f1a912bafa46c7f5f
133
+ commit dcf280239978e00435760470b5ddf67254312c75
144
134
  Author: Eric Wong <normalperson@yhbt.net>
145
- Date: Wed Feb 24 15:04:15 2010 -0800
135
+ Date: Mon May 3 18:51:18 2010 -0700
146
136
 
147
- switch to Unicorn.builder, depend on Unicorn 0.97.0+
148
-
149
- The Unicorn.builder helper will help us avoid namespace
150
- conflicts inside config.ru, allowing us to pass tests.
151
-
152
- While we're at it, port some tests over from the latest
153
- unicorn.git for dealing with bad configs.
137
+ event_machine: update documentation for async frameworks
154
138
 
155
- commit ecdc78d04e874f64bfea1b787aa8f3d469df8e79
139
+ commit 96f06e8171a4145feca8c750011cdd1d84a7b948
156
140
  Author: Eric Wong <normalperson@yhbt.net>
157
- Date: Fri Feb 19 22:14:39 2010 -0800
141
+ Date: Mon May 3 18:22:08 2010 -0700
158
142
 
159
- test-lib: make FIFO start check an after_fork hook
143
+ doc: misc updates
160
144
 
161
- enabling ready_pipe in Unicorn 0.96.0 breaks this.
145
+ * avoid needless links to /Rainbows.html
146
+ * keepalive_timeout has been 5 seconds by default for a while
147
+ * update "Gemcutter" references to "RubyGems.org"
162
148
 
163
- commit 08dfbae3d340114810fbd279c2ea29825d4b79e8
149
+ commit 60c57382638c8be81fe6163d1728415c494ad4f8
164
150
  Author: Eric Wong <normalperson@yhbt.net>
165
- Date: Thu Feb 18 19:33:13 2010 -0800
151
+ Date: Mon May 3 18:16:24 2010 -0700
166
152
 
167
- test-lib: remove needless fd closing
168
-
169
- too dangerous with the ready_pipe feature in Unicorn 0.96+
153
+ doc: RDoc 2.5.x updates
170
154
 
171
- commit 007bb3d73feacd30c8595025288f8a9e53ca5157
155
+ commit de3bcfe3ba9402bd510f7414df1763b6b99dae47
172
156
  Author: Eric Wong <normalperson@yhbt.net>
173
- Date: Sat Feb 13 00:53:34 2010 -0800
157
+ Date: Mon May 3 17:56:00 2010 -0700
174
158
 
175
- gemspec: bump dependency on Unicorn to avoid leak
159
+ cleanup request size limiting for TeeInput users
176
160
 
177
- The HTTP parser in Unicorn <= 0.96.0 did not use the Ruby API
178
- correctly. While this bug did not affect Unicorn itself,
179
- Rainbows! allocates a new Unicorn::HttpParser object for every
180
- client connection and Unicorn did not properly setup the parser
181
- object to be freed.
161
+ WAvoid mucking with Unicorn::TeeInput, since other apps may
162
+ depend on that class, so we subclass it as Rainbows::TeeInput
163
+ and modify as necessary in worker processes.
164
+
165
+ For Revactor, remove the special-cased
166
+ Rainbows::Revactor::TeeInput class and instead emulate
167
+ readpartial for Revactor sockets instead.
182
168
 
183
- commit de6b5dd5ffff6e21064f78f24c30c59e391ff370
169
+ commit 54cae80e543a6f4ca6456fe07b88aba867d215a6
184
170
  Author: Eric Wong <normalperson@yhbt.net>
185
- Date: Thu Feb 11 22:15:29 2010 -0800
171
+ Date: Mon May 3 17:17:13 2010 -0700
186
172
 
187
- use Hash#compare_by_identity for performance
188
-
189
- When available (Ruby 1.9), we can use Hash#compare_by_identity
190
- to improve performance.
173
+ max_body: remove extraneous debug message
191
174
 
192
- commit 71b8fff3d8d171c9770bb8c69767341c10d9c962
175
+ commit 798f5e3a507c20b4abf03aa8313659d3f632a0fa
193
176
  Author: Eric Wong <normalperson@yhbt.net>
194
- Date: Mon Feb 8 15:09:11 2010 -0800
177
+ Date: Mon May 3 15:19:53 2010 -0700
195
178
 
196
- t/bin/*: encoding should be the first line after shebang
179
+ t0100: rack-input-hammer tests identity encodings, too
197
180
 
198
- Ruby 1.9 will complain otherwise
181
+ It turns out we were painfully lacking in tests for HTTP
182
+ requests where the Content-Length header _is_ set.
199
183
 
200
- commit 9e01161030e68f0740e7821791fef4e38f828f1a
184
+ commit 9f1131f5972ba90c1c54c76cc97633447142b307
201
185
  Author: Eric Wong <normalperson@yhbt.net>
202
- Date: Mon Feb 1 19:44:33 2010 -0800
186
+ Date: Mon May 3 15:19:53 2010 -0700
203
187
 
204
- Rakefile: autoload Gem
188
+ add client_max_body_size config directive
205
189
 
206
- easier to manage for cases where rake isn't a gem itself
190
+ Since Rainbows! is supported when exposed directly to the
191
+ Internet, administrators may want to limit the amount of data a
192
+ user may upload in a single request body to prevent a
193
+ denial-of-service via disk space exhaustion.
194
+
195
+ This amount may be specified in bytes, the default limit being
196
+ 1024*1024 bytes (1 megabyte). To override this default, a user
197
+ may specify `client_max_body_size' in the Rainbows! block
198
+ of their server config file:
199
+
200
+ Rainbows! do
201
+ client_max_body_size 10 * 1024 * 1024
202
+ end
203
+
204
+ Clients that exceed the limit will get a "413 Request Entity Too
205
+ Large" response if the request body is too large and the
206
+ connection will close.
207
+
208
+ For chunked requests, we have no choice but to interrupt during
209
+ the client upload since we have no prior knowledge of the
210
+ request body size.
207
211
 
208
- commit 0b6fe07c10278266e2f428a4355b7edfc13781cd
212
+ commit 1f3de8f8940fc7805c54d3d27e2074632ab5a0b0
209
213
  Author: Eric Wong <normalperson@yhbt.net>
210
- Date: Fri Jan 8 16:44:44 2010 -0800
214
+ Date: Mon May 3 15:19:45 2010 -0700
211
215
 
212
- add Cramp integration tests
216
+ t0401: do not leave lingering tail(1) processes
213
217
 
214
- Tested with cramp-0.7 and eventmachine 0.12.10
218
+ Since Rainbows! allows for graceful termination, let
219
+ EM kill and reap the tail(1) processes it spawned.
215
220
 
216
- commit 23bf8da0774b21d8c55786b4b386faba4b53c97f
217
- Merge: ef16157 fddbfa6
221
+ commit b1153164af2f51dd5994f0efac6ea81adffdfee1
218
222
  Author: Eric Wong <normalperson@yhbt.net>
219
- Date: Fri Jan 8 00:07:38 2010 -0800
223
+ Date: Tue Apr 27 11:16:52 2010 -0700
220
224
 
221
- Merge branch 'rack-1.1'
222
-
223
- * rack-1.1:
224
- http_response: disallow blank, multi-value headers
225
+ gemspec: update comments for gem dependencies
225
226
 
226
- commit ef16157cd049743ba0b0cc237b6289bdd503a66e
227
+ commit 1d3bd978aa990fdd01ec4cd15a1b7276b91ffef6
227
228
  Author: Eric Wong <normalperson@yhbt.net>
228
- Date: Fri Jan 8 00:07:22 2010 -0800
229
+ Date: Tue Apr 27 11:14:47 2010 -0700
229
230
 
230
- local.mk.sample: bump Rack dependency
231
+ dev: isolate: bump Unicorn test dependency
231
232
 
232
- commit 5624bcde20a73fb91ca515afc01245d87fac2479
233
+ commit 7faf47b6bc50de4387697a90480e354acd0c9917
233
234
  Author: Eric Wong <normalperson@yhbt.net>
234
- Date: Thu Jan 7 23:37:35 2010 -0800
235
+ Date: Tue Apr 27 02:04:25 2010 -0700
235
236
 
236
- Update docs + tests to reflect Rev 0.3.2 release
237
+ base: status == 100 check needs to_i conversion
237
238
 
238
- Rev 0.3.2 makes performance with Threads* under Ruby 1.8
239
- tolerable.
239
+ Rack allows anything as the status, as long as it
240
+ returns a valid status integer on status.to_i.
240
241
 
241
- commit 1e902098533a4a66e8d6782b00703aa9a5eaa5f7
242
+ commit 85316b09eba1443508e78237b56e42292ab3b127
243
+ Merge: 72fdcf1 3d0558d
242
244
  Author: Eric Wong <normalperson@yhbt.net>
243
- Date: Wed Jan 6 14:43:36 2010 -0800
245
+ Date: Mon Apr 19 15:45:44 2010 -0700
244
246
 
245
- Fix "rainbows -h" and "rainbows -v"
247
+ Merge branch 'maint'
246
248
 
247
- Do not identify ourselves as "Unicorn", especially not
248
- for -v. Also "ENVIRONMENT" should be "RACK_ENV".
249
+ * maint:
250
+ Rainbows! 0.91.1 - use a less-broken parser from Unicorn
249
251
 
250
- commit fddbfa6929569685bcb92f54f6938df97bccd575
252
+ commit 72fdcf1c39c2a143d7abd8d2609e92311edff341
251
253
  Author: Eric Wong <normalperson@yhbt.net>
252
- Date: Tue Jan 5 17:48:13 2010 -0800
254
+ Date: Mon Apr 19 01:04:47 2010 -0700
253
255
 
254
- http_response: disallow blank, multi-value headers
256
+ add test for the rack-fiber_pool gem with EventMachine
255
257
 
256
- The HeaderHash optimizations in Rack 1.1 interact badly with
257
- Rails 2.3.5 (and possibly other frameworks/apps) which set
258
- multi-value "Set-Cookie" headers without relying on the proper
259
- methods provided by Rack::Utils.
258
+ Although advertised as being Thin-only, the rack-fiber_pool gem
259
+ works with our EventMachine concurrency model as well.
260
260
 
261
- While this is an issue with Rails not using properly, there
262
- may be similar apps that make this mistake and Rack::Lint
263
- does not guard against it.
261
+ Note that it's impossible to expose the streaming "rack.input"
262
+ behavior of the native FiberSpawn/FiberPool models via
263
+ middleware, but most people don't need streaming a "rack.input"
264
264
 
265
- Rack-ML-Ref: <20100105235845.GB3377@dcvr.yhbt.net>
265
+ See http://github.com/mperham/rack-fiber_pool for more details
266
+ on the rack-fiber_pool gem.
266
267
 
267
- commit d541fd3ee9aa4ddbc3b4f8a14bbea43de19a31d9
268
+ commit 98622a1c291277ff124a586929c675e9ae67692e
268
269
  Author: Eric Wong <normalperson@yhbt.net>
269
- Date: Wed Dec 30 02:17:17 2009 -0800
270
+ Date: Sun Apr 18 21:33:40 2010 -0700
270
271
 
271
- Rainbows! 0.90.1
272
+ use the excellent `isolate' gem for dev
272
273
 
273
- This release contains minor bugfixes/compatibility improvements
274
- for ThreadSpawn, ThreadPool and EventMachine users.
274
+ It should make life easier when dealing with and testing
275
+ complex dependencies, especially ones like Cramp which
276
+ depend on prerelease versions of gems.
277
+
278
+ commit b6dcf1343a379f0fb5de5cc551dbbf85da2b4cdf
279
+ Author: Eric Wong <normalperson@yhbt.net>
280
+ Date: Sun Apr 18 21:24:07 2010 -0700
281
+
282
+ rev/deferred_response: cleanup and simplification
275
283
 
276
- Excessive error messages from spurious wakeups using
277
- ThreadSpawn/ThreadPool under most platforms are silenced. Only
278
- Ruby 1.9 users under Linux were unaffected by this bug.
284
+ We can use the new HttpResponse.header_string method now
285
+ instead of writing an empty body.
286
+
287
+ commit ea36bb312bd9a35f9621d1cc406f8d07a37c2a2a
288
+ Author: Eric Wong <normalperson@yhbt.net>
289
+ Date: Sat Apr 17 11:08:22 2010 -0700
290
+
291
+ use IO.copy_stream for Thread{Spawn,Pool} under 1.9
292
+
293
+ This should be faster for serving static files and proxying IO
294
+ objects such as sockets/pipes. Unfortunately we cannot use this
295
+ reliably with non-blocking frameworks since IO.copy_stream will
296
+ release the GVL to block on I/O (rather than yielding a fiber
297
+ or returning from a callback).
279
298
 
280
- EventMachine users may now use EM::Deferrable objects in
281
- responses, vastly improving compatibility with existing
282
- async_sinatra apps.
299
+ Can't do HTTP/1.1 Range support, though :/
283
300
 
284
- commit c5a3c62647d8b45f83dba6306a80c8d3035cf3b3
301
+ commit 77f1e141e75f27b81bef5c3bddd01948d6236ebf
285
302
  Author: Eric Wong <normalperson@yhbt.net>
286
- Date: Wed Dec 30 01:54:50 2009 -0800
303
+ Date: Sat Apr 17 10:33:43 2010 -0700
287
304
 
288
- update TODO
305
+ http_response: split out header stringification code
289
306
 
290
- EM::Deferrables done, NeverBlock updates...
307
+ This will make it easier to use body#to_path if possible since
308
+ some concurrency models like EventMachine have optimized code
309
+ paths for serving static files.
291
310
 
292
- commit 96fbc5e91017c4912169629abc7dbb56cda9082c
311
+ commit b07004fc79867ba8f0cacde1508fb1e4fbf4c37d
293
312
  Author: Eric Wong <normalperson@yhbt.net>
294
- Date: Wed Dec 30 01:27:15 2009 -0800
313
+ Date: Fri Apr 2 01:49:39 2010 -0700
295
314
 
296
- EventMachine: support deferrables in responses
315
+ rainbows/http_*: remove unnecessary circular requires
297
316
 
298
- Some async apps rely on more than just "async.callback" and
299
- make full use of Deferrables provided by the EM::Deferrable
300
- module. Thanks to James Tucker for bringing this to our
301
- attention.
317
+ http_response and http_server are never NOT loaded when
318
+ "rainbows" is required.
302
319
 
303
- commit 44a80df0c4c0d47fd2ac503396cb9accfe770f0a
320
+ commit e0f9fb7cb8d8d47c68a9ebb0cb391d5880ca66d1
304
321
  Author: Eric Wong <normalperson@yhbt.net>
305
- Date: Tue Dec 29 21:18:02 2009 -0800
322
+ Date: Fri Apr 2 01:32:40 2010 -0700
306
323
 
307
- gemspec: clamp down unicorn dependency to < 0.97.0
324
+ use duck typing for REMOTE_ADDR detection
308
325
 
309
- We may be making some changes to Unicorn 0.97.0
310
- and allow us to share more code.
326
+ This gives us the option to use non-TCPSocket-derived
327
+ IO-ish objects in the future, whatever that may be...
311
328
 
312
- commit 31ee6b4daa1da9cd02e75b27924b2729345e999d
329
+ commit b04d465d65f896290d36538181d91dd264d10575
313
330
  Author: Eric Wong <normalperson@yhbt.net>
314
- Date: Tue Dec 29 12:59:01 2009 -0800
331
+ Date: Sun Mar 28 17:35:10 2010 -0700
315
332
 
316
- quiet spurious wakeups for accept() in Thread* models
333
+ cleanup: avoid redundant REMOTE_ADDR logic
317
334
 
318
- Under all MRI 1.8, a blocking Socket#accept Ruby method (needs
319
- to[1]) translate to a non-blocking accept(2) system call that may
320
- wake up threads/processes unnecessarily. Unfortunately, we
321
- failed to trap and ignore EAGAIN in those cases.
335
+ Every concurrency model does this the same way.
322
336
 
323
- This issue did not affect Ruby 1.9 running under modern Linux
324
- kernels where a _blocking_ accept(2) system call is not (easily,
325
- at least) susceptible to spurious wakeups. Non-Linux systems
326
- running Ruby 1.9 may be affected.
337
+ This removes the Rainbows::Const::LOCALHOST constant and
338
+ may break some existing apps that rely on it.
339
+
340
+ commit 12a4c53a47bb0c7bef5e2df732fa02532a969a54
341
+ Author: Eric Wong <normalperson@yhbt.net>
342
+ Date: Sun Mar 28 17:04:36 2010 -0700
343
+
344
+ fiber/base: do not modify hash during iteration (1.9.2dev)
327
345
 
328
- [1] - using a blocking accept(2) on a shared socket with
329
- green threads is dangerous, as noted in
330
- commit ee7fe220ccbc991e1e7cbe982caf48e3303274c7
331
- (and commit 451ca6997b4f298b436605b7f0af75f369320425)
346
+ It's generally dangerous to do so regardless of language and
347
+ Ruby 1.9.2dev is stricter about this sort of behaviour.
332
348
 
333
- commit d5375f5c24abfae0173007f47bc9e83139d556b5
349
+ commit 801ea41a8f183785827f659fd4c1d49189797f58
334
350
  Author: Eric Wong <normalperson@yhbt.net>
335
- Date: Thu Dec 24 17:56:47 2009 -0800
351
+ Date: Sun Mar 28 16:17:08 2010 -0700
336
352
 
337
- doc: update manpage since Unicorn got new features
353
+ local.mk.sample: bump neverblock test dep to 0.1.6.2
338
354
 
339
- working_directory and Worker#user got added over time, so
340
- recommending Dir.chdir and Process::UID.change_privilege
341
- is bad.
355
+ It continues to work with the old espace version from GitHub
356
+ repos, too.
342
357
 
343
- commit 831e0b2f89c3ae93b71631fcc5fcf7109697de88
358
+ commit 4619d902fb16f8eca76ea45948849490238879f9
344
359
  Author: Eric Wong <normalperson@yhbt.net>
345
- Date: Tue Dec 22 16:24:21 2009 -0800
360
+ Date: Fri Mar 26 20:00:18 2010 -0700
346
361
 
347
- gemspec: loosen Unicorn dependency
362
+ async_examples/async_app: avoid needless UTF-8
348
363
 
349
- Unicorn 0.96.x should be released once Rack 1.1 is out.
364
+ Unicorn stopped reading all config.ru files as binary
365
+ starting with 0.97.0 for compatibility with rackup(1),
366
+ so systems that defaulted to US-ASCII encoding would
367
+ have trouble running this.
data/DEPLOY CHANGED
@@ -1,5 +1,18 @@
1
1
  = Deploying \Rainbows!
2
2
 
3
+ == \Rainbows! only
4
+
5
+ For the daring, you should consider deploying \Rainbows! in a standalone
6
+ configuration. This will be more highly recommended as \Rainbows!
7
+ stabilizes, especially if static file performance improves (or you don't
8
+ need them).
9
+
10
+ You will need to do this to support things like BOSH or do real-time
11
+ processing of the request body as it is being uploaded.
12
+
13
+ In this case, haproxy or any similar (non-request-body-buffering) load
14
+ balancer should be used to balance requests between different machines.
15
+
3
16
  == nginx proxying to \Rainbows! or Unicorn
4
17
 
5
18
  For high-traffic applications, routing slow actions to \Rainbows! with
@@ -15,19 +28,6 @@ can forward fast actions to Unicorn.
15
28
  Be sure to set <tt>proxy_buffering off</tt> in nginx for "slow actions"
16
29
  if you have Comet applications (but not for Unicorn).
17
30
 
18
- == \Rainbows! only
19
-
20
- For the daring (or low-traffic sites), you should consider deploying
21
- \Rainbows! in a standalone configuration. This will be more highly
22
- recommended as \Rainbows! stabilizes, especially if static file
23
- performance improves (or you don't need them).
24
-
25
- You will need to do this to support things like BOSH or do real-time
26
- processing of the request body as it is being uploaded.
27
-
28
- In this case, haproxy or any similar (non-request-body-buffering) load
29
- balancer should be used to balance requests between different machines.
30
-
31
31
  == Denial-of-Service Concerns
32
32
 
33
33
  Since \Rainbows! is designed to talk to slow clients with long-held