root/trunk/CHANGES @ 708

Revision 708, 24.1 kB (checked in by marksmith, 2 years ago)

* make SSL non-blocking

New Perlbal::SocketSSL class that manages the SSL_WANT_READ/WRITE states
and doing the proper thing when the handshake is complete. Some rather
nasty work had to be done to make it all play well together.

Still not recommended to put Perlbal SSL into production anywhere. But it
would be great to get some eyes on this and some more testing.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1    -- make SSL non-blocking
2
3    -- make persist_client_timeout service tunable apply to the max_idle_time
4       value used to kill sockets that are idle
5
6    -- add Vpath plugin for selectors; can select on URI regex now
7
8    -- add ability to set default_service on selector services; any
9       request that is not caught by a selector plugin instead gets
10       routed to the defined default service
11
12    -- add MIME [ LIST | REMOVE <ext> | SET <ext> <mime> ] command for
13       managing the internal list of mime-types
14
15    -- return an error when trying to use HEADER command on a
16       service that isn't of role reverse_proxy
17
18    -- add hook to attach when a service selector is getting a client
19       returned to it.
20
21    -- fixed huge memory leak in Stats plugin
22
23    -- Fix t/15-webserver.t to not fail once in a while (timing glitch)
24
25    -- Fix handling of a proxy response that doesn't have a Reason-Phrase
26       on the HTTP status line.
27
28    -- Update 'queues' management command to output information about low
29       priority queue, now that we use it.
30
31    -- the buffered upload rate test should pass more reliably now.  some
32       people reported it sporadically (or often) failing before
33       
34    -- new per-service configuration value: persist_client_timeout -
35       timeout in seconds for HTTP keep-alives to the end user
36       (defaults to 30 seconds)
37
38    -- new server configuration value: pidfile - for managing an internal
39       pidfile.
40
411.59: 2007-05-22
42
43    -- only call die_gracefully on a socket if it CAN die_graceully.  fixes
44       shutdown graceful on mogstored, which has things betsides subclasses
45       of Perlbal::Socket in its Danga::Socket event loop
46
47    -- WARNING:  removed Linux::AIO support.  go get IO::AIO 1.6 at least if
48       you use webserver mode or reproxy files or do buffered uploads.
49
501.58: 2007-05-11
51
52    -- plugin reload support, if plugin supports it.  plugin must implement
53           sub can_reload { 1 }
54       and optionally:
55           sub pre_reload_unload { ... }
56       (which is called before the ->unload, module reload, and ->load)
57       new management command is:
58           reload <plugin_name>
59
601.57: 2007-04-26
61
62    -- make ClientHTTP (webserver mode) support transfer-encoding
63       "chunked" PUTs, when PUTs are already enabled.  useful
64       for things like MogileFS, where writing clients may not
65       know the final length ahead of time to predeclare in the
66       Content-Length request header.
67
68    -- Add the client_ip to the X-Forwarded-For header when the
69       upstream is "trusted" (Ask Bjoern Hansen).
70
711.56: 2007-04-16
72
73    -- make HTML proper in ClientManage interface Jacques Marneweck
74       <jacques@powertrip.co.za>
75
76    -- fix "make test" on OS X.  Radu Greab <radu@yx.ro> and
77       Chuck Remes <cremes.devlist@mac.com> fixed & confirmed.
78
79    -- let accesscontrol plugin have a new match action, "queue_low",
80       to make a match force a request onto the low-priotity queue.
81       this match action is in addition to the two previous ones
82       (allow and deny).
83
84    -- start of work on making BackendHTTPs be abstract, dispatching
85       to a child process over a socketpair which speaks HTTP on
86       stdin/stdout.  Unfinished.  To be polished in future.
87
88    -- new hook "make_low_priority", like "make_high_priority"
89
901.55: 2007-03-21
91
92    -- add plugin that returns 304 automatically on incoming requests
93       with If-Modified-Since header and matching a regular expression
94       on the Host header. (for hostnames serving immutable resources,
95       where if client has ANY version, it's the correct one.)  see:
96       example conf at conf/not-modified-plugin.conf
97
98    -- do HEAD to reproxied hosts, if client did a HEAD (Radu Greab
99       <radu@yx.ro>)
100
101    -- fix race+crash in buffered upload writing/purging
102
1031.54: 2007-02-05
104
105    -- supported for "Transfer-Encoding: chunked" requests (HTTP/1.1 feature)
106       as well as the "Expect: 100-continue", which generally accompany
107       chunked requests.  requires "buffered_uploads" be enabled.  see
108       doc/http-versions.txt for details.
109
1101.53: 2006-12-05
111
112    -- fix a crash as reported on mailing lists, with backends not
113       releasing references to clientproxies when coming through
114       service selectors, and backends then timing out, crashing
115       the server.
116
117    -- if backend sends x-reproxy-url and HTTP 204 No Content, upgrade
118       that to a 200 when sending to the client.
119
120    -- let non-Perlbal::Socket Danga::Socket objects exist without
121       crashing in cleanup handler (allows use of Gearman::Client::Async
122       in plugins)
123
1241.52: 2006-11-13
125
126    -- fix crash in buffered uploads when *::AIO doesn't write everything
127       to disk that's requested of it.  we were unshifting back onto the
128       write queue a scalar, not a scalarref.
129
130    -- AIO channels.  from the code:
131
132       "prevents all AIO threads from being consumed by requests for same
133        failing/overloaded disk by isolating them into separate 'channels' in
134        parent process and not dispatching more than the max in-flight count
135        allows.  think of a channel as a named queue.  or in reality, a disk."
136
137    -- allow setting of SO_SNDBUF on a per-service level
138
1391.51: 2006-10-04
140
141    -- set alive_time during slow PUTs.  was causing problems
142       replicating large files in mogile, hitting fake idle timeout.
143
144    -- pipelining HTTP injection fix.
145
146    -- include Host header to reproxy backends
147           patch by Jonty Wareing <jonty.wareing@gmail.com>
148
1491.50: 2006-09-08
150
151    -- add in optional Devel::Gladiator usage for memory tracking
152
153    -- fix memory leaks in concatenanted GETs on error cases
154
155    -- fixes to run / run better on OS X (Artur Bergman)
156
1571.49: 2006-08-30
158
159    -- Very basic help hints command, simply dumps all possible commands.
160
161    -- Add another statistic for reproxy caches, the current size of a particular
162       service's cache, maximum size, and fill percentage.
163
1641.48: 2006-08-18
165
166    -- optionally cache in-process the results of X-Reproxy-URL reponses
167
1681.47: 2006-08-15
169
170    -- concatenanted GETs sent 304 Not Modified w/ content-lengths.  should
171       be without.  fixed.  also including t/17-webserver-concat which forgot
172       to be checked into svn/MANIFEST earlier
173
1741.46: 2006-08-10
175
176    -- fix Mart's broken win32 support that broke Unix, part 2:  syslog when
177       daemonized.  TODO: test case should test daemonization mode.
178
1791.45: 2006-08-10
180
181    -- fix Mart's broken win32 support that broke Unix.  TODO:  test to raise/check
182       fd limit so this doesn't happen again on unix.
183
1841.44: 2006-08-10
185
186    -- allow a no-op ?foo at the end of concatenated-get URLs, so they'd be of
187       the form:  http://host/dir??file1,file2,file3?noopsection.  the no-op
188       section is good for cache-busting, putting in, say, the modtime of the
189       newest file, forcing browsers like safari (who over-cache) to reload.
190
191    -- set a mime-type other than text/plain on concatenated-get requests,
192       only falling back to text/plain if none of files have a known mime type.
193       in practice a request is all css or all js, so match is found by looking
194       at 1st file.  this is required since mozilla won't show CSS if not text/css.
195
196    -- actually be able to start up using 'perlbal' command.  test
197       suite passed before, but moving $VERSION into Perlbal.pm
198       had quitely broke it all.
199
2001.43: 2006-08-09
201
202    -- there's a case where offset gets past end of file in static file
203       code, but very rarely.  sendfile handles this w/ an error that
204       we dealt with, but the new readahead code didn't and crashed.
205       working around for now, until root cause is found for offset
206       going past.
207
208    -- eliminate some warnings in error cases.  only really affects noise
209       in test suite
210
211    -- work better on win32
212
213    -- added the ability for plugins to create custom service roles and
214       add custom configuration options to services, demo is available
215       as conf/echoservice.conf and lib/Perlbal/Plugin/EchoService.pm
216
2171.42: 2006-08-03
218
219    -- debug management command 'varsize' to track size of internal
220       data structures, to make sure none get out of control.
221       there's a report that CPU/mem grow slowly over time, and after
222       a month or so of uptime, a restart is needed.  this might help
223       diagnose that.
224
225    -- allow expansion/interoplation of stuff in config files/commands.
226       for now just mapping network device names to IP addresses:
227          SET listen = ${ip:eth0}:80
228
229    -- more hooks as requested by community
230
231    -- concatenated get feature.  where a client have use a
232       comma-separated list of files to return, always in text/plain.
233       Useful for webapps which have dozens/hundreds of tiny css/js
234       files, and don't trust browsers/etc to do pipelining.
235       Decreases overall roundtrip latency a bunch, but requires app
236       to be modified to support it.  See t/17-concat.t test for
237       details.
238
239    -- do AIO readahead before sendfile to reduce blocking caused
240       by disk reads from sendfile.  increases throughput.  see:
241       http://brad.livejournal.com/2228488.html
242
243    -- add 'latency' configuration on selector roles
244
2451.41: 2006-02-06
246
247    -- IE sends a request header like "If-Modified-Since: <DATE>;
248       length=<length>" so we have to remove the length bit before
249       comparing it with our date then we save the length to compare
250       later.
251
252    -- support for reproxying to a named service.  if backend returns
253       "X-Reproxy-Service: <name>" and no content, the entire original
254       client GET/HEAD request is re-sent to the new named service.
255       the "enable_reproxy" option has to be enabled for the original
256       service.
257
2581.40: 2006-01-17
259
260    -- support for optional retrying of requests after a 500 error,
261       so user won't see the 500 error.  boolean option, as well
262       as configurable schedule of how often to retry backends.
263
264    -- clean up directory indexing HTML: Mark Smith and Fred Moyer
265       (fred@redhotpenguin.com)
266
2671.39: (beta for 1.40) 2005-10-26
268
269    -- new feature for virtual host plugin:  the Host header can be trumped
270       by a magical URL form, if allowed in config.  for instance, you can
271       make an HTTP request to host "foo.com" but actually get "bar.com"
272       if you do this:
273
274          VHOST foo.com;using:bar.com  = bar
275
276       and request /__using/bar.com/IDENT from foo.com, where IDENT is
277       just \w+.  perlbal then updates the Host record to bar.com and
278       sends request URI (unaltered) to the "bar" service.
279
280       this is useful for circumventing browser host restrictions (java,
281       javascript, flash, etc...) when you actually control both
282       domains.
283
2841.38: (beta for 1.40) 2005-10-19
285
286    -- some paranoia evals around some parts of buffered uploads that
287       SAPO reported crashes in occasionally.  added FIXMEs to investigate
288       too.  for now, though, evals around closing files is safer.
289
290    -- new feature: inter-perlbal upload tracking.  for fancy upload
291       bars driven by XmlHttpRequest when clients are upload large files
292
293    -- WARNING: reproxying (files or URLs) is now disabled by default,
294       and must be enabled per-service with "enable_reproxy = true"
295
296    -- do a final little read before closing an HTTP connection
297       to make sure we have no unread data in kernel (notably
298       an extra "\r\n" from an IE post), so when we do close, we
299       don't send a RST packet to the end user.  Thanks to Kevin
300       Lewandowski from discogs.com for the bug report.
301
302    -- use Danga::Socket's AddTimer interface to disconnect
303       stale persistent connections every 5 seconds, driven by
304       a timer, rather than every 15 seconds, driven by
305       socket creation.
306
307    -- there was a bug where 304 Not Modified responses would
308       cause a connection close (and thus RST packets) even
309       though keep-alive was negotiated and would've worked
310
311    -- ignore URL arguments when doing directory indexing
312
313    -- work a little better under "trickle".  (but still not perfect...
314       trickle doesn't quite work on Perlbal, unfortunately. it's useful,
315       or would've been useful, for testing some parts...)
316
317    -- avoid an occasional warning with dirindexing on unreadable directories
318
3191.37 (beta for 1.40) 2005-08-29
320
321    -- "use <name>" command to set the direct object for future commands
322
323    -- AccessControl plugin to allow/deny by default or on IPs or
324       netmasks.
325
326    -- ClientManage could spin in its inherited event_write, causing
327       99.9% cpu usage.  Bug is arguably Danga::Socket's, but also
328       ours because it's documented what we should do and we didn't.
329       The fix is to shut down watching writability when we're done
330       writing.
331
332    -- make accept_client and its callers deal with the possibility
333       that accept_client fails not because the backend is bogus, but
334       because the client is.  so now accept_client can close the
335       client and callers have to be aware of that.
336
337    -- after running this version on production on LiveJournal.com for
338       a bit, we discovered some cases that we'd flag as should never happen,
339       but actually do, so updated the comments and behavior to
340       do the right thing and not just crash with an assertion.
341
342    -- fix misspellings of trusted_upstream_proxies that didn't
343       come along for the renaming ride earlier
344
345    -- webserver mode now ignores URL arguments when looking up
346       filename
347
348    -- remove warnings accessing undefs in ranges and vhosts
349
350    -- new --version and --help flags.  also a usage message on bogus
351       options (or when --help).  props to Jacques Marneweck
352       <jacques@powertrip.co.za> for the help and motivation.
353
3541.36 (beta for 1.40) 2005-08-19
355
356    -- fix bug in ClientProxy when user disconnects after POST/PUTing
357       a content body, but before a response comes back.
358
359    -- now checks correctly for Danga::Socket version 1.44 or above.
360       (required version was in quotes, confusing perl.)
361
362    -- vhost plugin: strip off port specification from the Host header
363       before trying to match with configured patterns.
364
3651.35: (beta of 1.40) 2005-08-16
366
367    -- beta SSL support in a few lines of code.  maybe it's completely
368       done.  maybe it's barely done.  But it seems to work?  I'm no
369       SSL master... IO::Socket::SSL just made it so easy.
370
371    -- lots more tests
372
373    -- lots more cleanup
374
375    -- fix potential crashing bugs in the PUT path.  luckily ones we
376       never hit.
377
378    -- lots and lots of code cleanup
379
380    -- load plugins by either the exact case specified, all lowercase,
381       or all lowercase with first letter uppercase.  then remember
382       the case for unloading (which was never implemented?)
383
384    -- reorganize/cleanup code related to stalling the backend due to
385       client's buffer size exceeding one of the two limits.
386       introduce "backend_stalled"
387
388    -- buffer uploads to disk
389
3901.3: (2005-06-26)
391
392    -- introduce CommandContext, so management commands can be less
393       verbose when in config files (service/pool names can be left off
394       when you just created them a couple lines before)
395
396    -- remove sendstats support
397
398    -- exit with 0 vs non-zero when/if Perlbal crashes.  new command
399       "crash" to fake a crash, for testing.
400
401    -- entirely redone management command parsing/dispatching (major
402       code cleanup)
403
404    -- virtual host plugin on service selector framework
405
406    -- service selector framework
407
408    -- make Net::Netmask optional
409
410    -- byte range support for both webserver mode and reproxy-file mode
411       Giao Phan <giao@guba.com>.  so clients can resume large transfers.
412
413    -- test suite
414
415    -- IO::AIO support (brad)
416
417    -- change response code to client to 200 on reproxy-file from backend
418
419    -- 'nodes' command now takes as an optional argument a specific ip:port to
420       dump the node stats for
421
422    -- AIO abstraction layer (Perlbal::AIO) which can currently do either
423       Linux::AIO or "none" (doing everything sync).  also in future File::FDpasser
424       and other OS-specific modes [brad]
425
426    -- add buffer_backend_connect to do in memory buffering of data before we
427       request a backend; assists slow clients without tying up a mod_perl
428
429    -- fix spinning issue when webnodes unavailable; should now not consume 100%
430       CPU in those cases
431
432    -- revamp verbose functionality; by default it's still of, but if you specify
433       VERBOSE ON in the config file, it turns it on for management connections
434       by default.  management connections, when specifying VERBOSE ON/OFF, will
435       now set the flag only for that connection.
436
437    -- new command for config file; VERBOSE ON/OFF; can be used to enable or
438       disable confirmation of all commands such as SET, SERVER, CREATE, etc.
439       by default, it's off for config files, but on for management connections.
440
441    -- add generation count to services that increments every time a pool is
442       switched.  this data is now stored on backends when they're spawned as
443       well, and when we allocate a backend we verify the generation so old ones
444       are thrown away.
445
446    -- allow setting of nodefile on pools to 'none' or 'null' or 'undef' or just
447       an empty set of quotes ("", '') in order to stop using node files
448
449    -- automatically set use count to 0 on new nodes coming in from nodefile
450
451    -- made auto-vivification of pulls throw warnings, and made Perlbal die if it
452       tries to vivify a pool and the user has previously manually declared a pool
453
454    -- updated pool commands to be more flexible (POOL pool ADD node, etc)
455
456    -- add pools; a way of having different sets of nodes and instantly switching
457       between them, so traffic stops going to old nodes; see the example config
458       file for usage
459
460    -- work partially without Linux::AIO (does sync stat of node file in reverse
461       proxy mode, and webserver mode doesn't work) --brad
462
4631.2 (2005-03-07)
464    -- add new stats command 'nodes' that shows information on each node that we've
465       been connecting to -- last connect time, last attempt time, a breakdown of
466       the last 500 status codes returned, etc
467
468    -- add ability to use new Danga::Socket profiling; 'profile on', 'profile data'
469       to see the info so far, and 'profile off' to disable it
470
471    -- graceful shutdown now flags sockets that are busy to die so they die when
472       they're done with their current connection
473
474    -- sockets in persist_wait now get closed immediately during a graceful shutdown
475
476    -- fix handling of OPTIONS responses; used to do its own state clearing but
477       it now uses the next_request method as it should
478
479    -- fix bug with determination of keep-alive in http 1.1 case specifying
480       a connection: close header
481
482    -- added 'uptime' management command to track how long Perlbal has been up
483
484    -- new config commands: HEADER INSERT <svc> <header>: <value> and HEADER
485       REMOVE <svc> <header> which will insert and remove headers from user
486       requests before they're sent to backend proxy nodes.
487
488    -- add dependency to Net::Netmask; now you can specify trusted_upstream_proxies
489       on a service (SET service.trusted_upstream_proxies = 10.0.0.0/8, etc)
490       which will allow requests from that range to set X-Forwarded-For, X-Host,
491       and X-Forwarded-Host headers.
492
493    -- fixed a bug that caused connections to hang when the backend responded
494       before the user was done sending data
495
496    -- reset some variables that weren't being reset: read_buf, read_ahead, read_size
497
498    -- "proc" management command shows user and system CPU usage for Perlbal
499       this run, as well as a delta since the last time you ran "proc"
500
501    -- added Perlbal::XS interface for modules to use; also 'xs' management
502       command to see the status of XS modules
503
504    -- bug in PalImg caused crash on files with no length (or when another
505       error occurs that causes no data to be sent to new_gif_palette function)
506
507    -- ReproxyManager would sometimes let closed backends back into the pool
508       and hand them off to clients, fixed to check for that
509
510    -- new policy: you don't muck around with the internals of other classes.
511       notably, clients don't change the internals of a backend and backends
512       don't change the internals of a client.  this was causing all sorts of
513       problems because nobody was cleaning up properly.  (especially with regard
514       to "who is my backend's client" type questions.)
515
516    -- fixed up code that did its own keep-alive checks to use the HTTPHeaders
517       functions so that in the future every part of the code stays up to date
518
519    -- Perlbal::Socket now has the option to keep track of all objects that
520       are created.  new command to management interface 'leaks' will show
521       all objects currently in memory.  turn this functionality on by enabling
522       the TRACK_OBJECTS constant in Perlbal::Socket.
523
524    -- split keep-alive logic into request and response methods and cleared
525       up how that works
526
527    -- rewrote reproxy URI support.  new class Perlbal::ReproxyManager does all
528       of the work relating to reproxies.  it's basically a service class but
529       stripped down and dealing with single endpoints instead of pools.  much
530       much much more robust under heavy load.  (Junior, Brad)
531
532    -- now that we support persistent connections, the 'queues' command didn't
533       have an accurate time; added ClientProxy member last_request_time so
534       we can accurately tell how long requests have been waiting for
535
536    -- Danga::Socket got an overhaul; close and steal_socket now share a lot
537       of code by calling _cleanup.  some more paranoia on making sure the
538       object isn't already closed when we try to do things.
539
540    -- lots more paranoia in close events and event_err handling for backends
541
542    -- added tracking mode for helping look for leaked objects; records a
543       backtrace of every object created.  "server track_obj = 0/1" to enable
544       or disable it, and then "tracking" in a management interface to see.
545
546    -- made Perlbal::objctor/objdtor take an object as their first parameter.
547       much faster than using caller().
548
549    -- fix Highpri plugin to not check hosts for high priority values when
550       the host isn't defined
551
552    -- made Palimg plugin far more paranoid about errors, and also uses new
553       ClientHTTPBase scratch area for keeping track of data instead of using
554       headers (which are generally slower)
555
556    -- fixed bug in HTTPHeaders that set_version would inadvertently
557       run into when used on a header created through new_response
558
559    -- ClientProxy class now supports persistence; set persist_client on
560       the proxy service in order to enable it.
561
562    -- Palimg plugin now supports fallback to web server mode if the
563       requested URI doesn't fit our desired pattern
564
565    -- did some cleanup; made a bunch of HTTPHeaders accesses use the
566       accessor methods instead of referencing into the object's private
567       store of data
568
569    -- fixed a crash caused by calling getsockname/getpeername on sockets
570       that have been undefined after having been stolen during an internal
571       redirect to another webserver
572
573    -- fixed _simple_response to not return a body if we're serving
574       to a HEAD request
575
576    -- bug fix: don't send Not-Modified responses to requests for dynamic
577       directory listings.  it was messing up persistent connections
578       since the directory serving code didn't get passed down whether we
579       were sending a body or not.  and not modifies on directories are hard:
580       modify time isn't altogether useful.  (file sizes could change)
581
582       this still does not-modifieds on indirect index.html directory
583       requests, because _serve_request ends up eventually calling
584       _serve_request on a different URI.  (brad)
585
586    -- added BSD::Resource as dependency to Makefile.PL (brad)
587
588    -- fixed 304 Not Modified responses to not send Content-Length
589       and Content-Type headers.  (jr)
590
5911.01 (2004-10-22)
592    -- when internally redirecting a URL, perlbal advertises
593       that it supports persisent HTTP connections now,
594       and caches those sockets for 5 seconds.  (not configurable)
595       useful under load, otherwise you waste all local ports
596       on a machine
597
598    -- ditch dependence on IO::SendFile.  do it ourselves (1 line)
599       with perl's syscall function
600
601    -- add doc/* and conf/* to MANIFEST file
602
6031.00
604    -- initial packaged release
Note: See TracBrowser for help on using the browser.