Changes of Revision 13
[-] | Changed | crossroads.spec |
x 1
2 Summary: Load balance and fail over utility for TCP based services 3 Name: crossroads 4 -Version: 2.62 5 +Version: 2.65 6 Release: 1 7 License: GPLv3 8 Group: Applications/Utilities 9
10 %{_mandir}/man5/xrctl.xml.5.gz 11 12 %changelog 13 +* Thu Jul 29 2010 Carsten Schoene <cs@linux-administrator.com> - 2.65-1 14 +2.65 [KK 2010-04-26] 15 +- Bugfix in backend/connect.cc - if the determination whether a back 16 + end is available goes haywire, the client socket may stay open and 17 + not be consumed. Thanks Franz J. for reporting! 18 +- Version stamped as STABLE. 19 + 20 * Thu Jan 21 2009 Carsten Schoene <cs@linux-administrator.com> - 2.62-1 21 2.62 [KK 2010-01-08] 22 - Fixed possible coredump cause in Balancer::serve(), which might 23 |
||
[+] | Changed | crossroads-stable.ChangeLog ^ |
@@ -1,3 +1,257 @@ +2.65 [KK 2010-04-26] +- Bugfix in backend/connect.cc - if the determination whether a back + end is available goes haywire, the client socket may stay open and + not be consumed. Thanks Franz J. for reporting! +- Version stamped as STABLE. + +2.64 [KK 2010-01-29] +- Fixed signal handling for start/stop/restart. +- Web interface now immediately shuts down at a stop request, so that + next xr instances can grab the web interface port immediately. + +2.63 [KK 2010-01-11] +- Previous 2.62 stamped as stable, 2.63 will be the new development + trunk. + +2.62 [KK 2010-01-08] +- Fixed possible coredump cause in Balancer::serve(), which might + explain some troubles during high load (many really concurrent requests). + +2.61 [KK 2009-11-17] +- Netbuffer::netwrite() will abort after 5 attempts that yield 0 + written bytes. Probable cause of CPU hogging - thx Franz J. for + reporting. +- Fixed potential cause of crashes in base class for Dispatcher + (algorithm handler would not get initialized in the constructors). + +2.60 [KK 2009-11-02] +- Some errors demoted to informational messages to choke the amount of + log information that's generated. + +2.59 [KK 2009-10-14] +- Bugfix in logger handling of xrctl, read + http://xrforum.org/viewtopic.php?t=495 if you fancy. Thanks Hobbit + for reporting this! + +2.58 [KK 2009-10-14] +- Added test/ftp.xml as a sample ftp service configuration. +- Implemented URL-based dispatching: flag --url-match/-j, present in + xrctl, tested in test/urlmatch.xml, added to web interface +- Usage information now shows long versions of flags first. + +2.57 [KK 2009-09-14] +- Output of "xrctl status" colorized when a service is not running, + thanks Frederik D. for the suggestion and the code! +- Small cleanup of xrctl's usage information. + +2.56 [KK 2009-05-26] +- Bugfix in cleaning of IPStore map +- Implemented flag --remove-reservations (xrctl: tag: removereservations) +- Timeouts adjusted: all read time outs set to 30, client-write set to + 5, backend-write set to 3 +- Implemented tag prefixtimestamp in system block to force timestamping. + +2.55 [KK 2009-05-13] +- Implemented connection error counting of back ends. +- Select-handling revised: atomic readability and writeability checks, + see xr/fdset/wait.cc and wait_r(), wait_w(), wait_rw(). +- Checks for connect() success can be configured to verify only + writeable status of a socket (see xr/backend/connect.cc, macro + CONNECTCHECK_ONLY_WRITABLE in xr/etc/Makefile.class). +- Added test/xr-mysql-connect. +- Added commands kill and killstart to xrctl. Action restart renamed + to stopstart. +- Added simple benchmarking under test/: xr-http-test (based on an + older script) and xr-smtp-test. Plus a simple analyzer of the + reported timings, xr-analyze-test. +- Revamped stored-ip dispatcher, added IPStore class to keep track of clients. + +2.54 [KK 2009-04-29] +- Stamped new STABLE version. + +2.53 [KK 2009-04-24] +- test/xr-client-ping now can live without LWP::UserAgent. When this + Perl module is not present, the script will fall back to wget/curl. +- Upon thread kill, sockets are closed using socketclose() + (sys/socketclose.cc), which also shutdown()s the socket. +- Bugfix in xrctl regarding new format of client/backend timeout. + +2.52 [KK 2009-04-21] +- Bugfix in the roundrobin dispatcher. When only one back end would be + up, then the roundrobin dispatcher would incorrectly compute the + right back end. This bug only became visible with host-matching in + HTTP mode. + +2.51 [KK 2009-04-15] +- Separate "write" timeouts introduced in flags -t and -T +- Web interface activity overview includes client ip addresses +- Added test/xr-client-ping (see docs) + +2.50 [KK 2009-03-30] +- Bugfix in activation of the onfail script in the checkup thread. +- Compilation flag -Werror only passed to the compiler when on the + development system Thera.local (see xr/etc/Makefile.class). +- Onstart, onend and onfail scripts (when present) are invoked with a + third argument, the number of connections at the time +- Set-Cookie header directive (see the HTTP dispatcher) attaches an + explicit path "/". +- Rewired the tcp dispatcher and http dispatcher to use a common + buffer inside the tcp dispatcher (instead of 2 separate ones). + +2.49 [KK 2009-03-27] +- Implemented onfail hook (to complement onstart/onend, flag -y). + +2.48 [KK 2009-03-26] +- Implemented onstart/onend hooks (flags -z, -Z). +- Sticky HTTP mode inspects the URI (parameter XRTarget) when no + sticky cookie is present. + +2.47 [KK 2009-03-04] +- Stored-ip dispatching was enhanced to "anticipate" reconnects from + previously seen clients. The number of anticipated connections is taken + into account when dispatching a new client. +- Bugfix in command line parsing of dispatch mode lax-stored-ip (would + be recognized as strict). + +2.46 [KK 2009-02-18] +- Dispatcher-related classes moved under directory xr/Dispatchers/. +- UDP balancer implementation started (code stubs in place). +- xrctl bugfixed: a backend-scope maxconnections statement would + confuse the global server block. Thanks Rajeev for reporting. + +2.45 [KK 2009-02-18] +- Usage information formatted. +- Rubberstamped "stable"! + +2.44 [KK 2009-02-11] +- Reviewed code for "throw"s (edited for consistency). +- Bug in Webinterface::execute() (during accept()). Thanks Vladimir T. + for reporting and testing. + +2.43 [KK 2009-02-09] +- Added Httpbuffer::replaceheader() methods +- Added flag -I (to replace Host: headers), integrated in xrctl / + webinterface +- Webinterface reports approx. # of open fd's and the limit (in activity) + +2.42 [KK 2009-01-28] +- Bugfix in "xrctl generateconfig". The activity info introduced + before (which the web interface now emites), confused xrctl. +- Bugfix in sys/ipmatch.cc: mask matching corrected for systems where + longs are not 4 bytes (64bit systems). +- Bugfix in hashed-ip dispatch mode: When no back ends were available, + the dispatcher would crash (fixed). +- XSLT stylesheet that transforms web interface slightly changed to + improve the looks. +- Bugfix in xrctl's "rotate" action. Thanks "ncisrael" for reporting + it in the forum. + +2.41 [KK 2009-01-05] +- Bugfix in xrctl, thanks Eddie for reporting it. + +2.40 [KK 2009-01-03] +- Netbuffer::read() failures are no longer logged as errors, but as + verbose messages. +- XML configuration now supports "logger" to redefine logger program. +- Small changes to xrctl: ps command is auto-guessed when not + specified in the XML configuration. + +2.39 [KK 2008-12-04] +- Added Httpbuffer::reset() +- The HTTP dispatcher will show back end error returns (when the HTTP + code is in the 400 or 500 range) +- main() will show runtime limits when invoked with -v +- The HTTP dispatcher no longer downgrades to HTTP/1.0 and closed + connections. Webserver back ends can do this. +- Exceptions during the sending of an error page in HTTP mode are + discarded, no longer logged. +- Mutex lock added around thread startups (see Thread::start()), when + requested soq in sys/sys. +- Mutex locks around malloc()/realloc(), when requested so in sys/sys. +- Fixed possible socket leak in TcpDispatcher::execute(). The back end + socket might not have been closed when the dispatch phase crashed. +- Dispatchers are now derived from a new base class Dispatcher, in + preparation for UDP handling. +- Timestamp handling centralized in a class Timestamp. +- Messaging (msg(), debugmsg(), reportmsg(), warnmsg()) centralized. +- Started threads are administered in Threadlist. Separate threads are + killable from the web interface, or all threads to a given back end. + +2.38 [KK 2008-11-19] +- Bugfix in xrctl: Weights and max connections in back ends are now + passed correctly. +- Added version ID to xrctl. + +2.37 [KK 2008-11-17] +- Main accept-loop in Balancer::serve() doesn't throw an exception + when a network connection can't be accepted. The reason is shown in + a warnmsg(). + +2.36 [KK 2008-11-11] +- Typo bugfix in xrctl, fixed. +- xrctl will take the environment's PATH if no path is given in the + configuration. + +2.35 [KK 2008-11-11] +- The wakeup and checkup thread are always started, even when no + wakeups or checkups are defined. Reason is that later these timers + can be set in the web interface, so we want the threads running. + When no checks/wakeups are applicable, the threads will recheck each | ||
[+] | Changed | crossroads-stable.tar.gz/ChangeLog ^ |
@@ -1,3 +1,17 @@ +2.65 [KK 2010-04-26] +- Bugfix in backend/connect.cc - if the determination whether a back + end is available goes haywire, the client socket may stay open and + not be consumed. Thanks Franz J. for reporting! + +2.64 [KK 2010-01-29] +- Fixed signal handling for start/stop/restart. +- Web interface now immediately shuts down at a stop request, so that + next xr instances can grab the web interface port immediately. + +2.63 [KK 2010-01-11] +- Previous 2.62 stamped as stable, 2.63 will be the new development + trunk. + 2.62 [KK 2010-01-08] - Fixed possible coredump cause in Balancer::serve(), which might explain some troubles during high load (many really concurrent requests). | ||
[+] | Changed | crossroads-stable.tar.gz/Makefile ^ |
@@ -1,7 +1,7 @@ # Top-level Makefile for XR # ------------------------- -VER = 2.62 +VER = 2.65 PREFIX = $(DESTDIR)/usr BINDIR = $(PREFIX)/sbin MANDIR = $(PREFIX)/share/man | ||
Changed | crossroads-stable.tar.gz/doc/xr.odt ^ | |
Changed | crossroads-stable.tar.gz/doc/xr.pdf ^ | |
[+] | Changed | crossroads-stable.tar.gz/xr/backend/connect.cc ^ |
@@ -6,7 +6,7 @@ // Assume the backend is dead islive = false; - debugmsg ("Connecting to back end " + description() + "\n"); + debugmsg ("About to connect to back end " + description() + "\n"); // Create client socket if ( (clsocket = socket (PF_INET, SOCK_STREAM, 0)) < 0 ) @@ -54,18 +54,22 @@ fdset.add (clsocket); fdset.wait_rw(); - debugmsg(Mstr("Connectiong to ") + description() + "\n"); + debugmsg(Mstr("Connecting to ") + description() + "\n"); # ifdef CONNECTCHECK_ONLY_WRITABLE if (fdset.writeable(clsocket)) islive = true; - else + else { markconnecterror(); + socketclose(clsocket); + } # else if (fdset.writeable(clsocket) && !fdset.readable(clsocket)) islive = true; - else + else { + socketclose(clsocket); markconnecterror(); + } # endif } | ||
[+] | Changed | crossroads-stable.tar.gz/xr/balancer/balancer ^ |
@@ -50,6 +50,7 @@ bool term; bool rep; bool rest; + Webinterface *webinterface; }; extern Balancer balancer; | ||
[+] | Changed | crossroads-stable.tar.gz/xr/balancer/balancer1.cc ^ |
@@ -2,5 +2,5 @@ Balancer::Balancer () : server_fd(-1), request_nr(0), backends(), - term(false), rep(false), rest(false) { + term(false), rep(false), rest(false), webinterface(0) { } | ||
[+] | Changed | crossroads-stable.tar.gz/xr/balancer/init.cc ^ |
@@ -15,10 +15,10 @@ // Start the web interface if requested. if (config.usewebinterface() && !config.foregroundmode()) { - Webinterface *w = new Webinterface(); - if (! w) + webinterface = new Webinterface(); + if (! webinterface) throw Error("Memory fault in Balancer::init"); - w->start(); + webinterface->start(); } // Add workable back ends, display initial states. | ||
[+] | Changed | crossroads-stable.tar.gz/xr/balancer/serve.cc ^ |
@@ -198,6 +198,7 @@ // Wait for running threads to die off. socketclose (server_fd); + delete webinterface; unsigned prev_conn = 0x19081962; while (1) { unsigned curr_conn = balancer.connections(); | ||
[+] | Changed | crossroads-stable.tar.gz/xr/sys/main.cc ^ |
@@ -56,16 +56,9 @@ * web interface. */ balancer.report(true); break; - case SIGPIPE: - case SIGSTOP: - /* SIGPIPE is ignored (See below). Leaving in place for future - * versions. SIGSTOP is used for stopping separarte treads. */ + default: balancer.terminate(true); break; - case SIGSEGV: - /* Production-grade protection - don't ever crash! */ - balancer.restart(true); - break; } } @@ -75,7 +68,6 @@ static int relevant_sig[] = { SIGHUP, SIGINT, SIGQUIT, SIGABRT, SIGTERM, SIGSTOP, - // SIGSEGV }; try { | ||
[+] | Changed | crossroads-stable.tar.gz/xr/webinterface/answer.cc ^ |
@@ -1,4 +1,5 @@ #include "webinterface" +#include "balancer/balancer" static void stop_backend_thread(pthread_t id) { Threadinfo info = Threadlist::info(id); | ||
[+] | Changed | crossroads-stable.tar.gz/xr/webinterface/answerstatus.cc ^ |
@@ -1,4 +1,5 @@ #include "webinterface" +#include "balancer/balancer" void Webinterface::answer_status() { string xml = | ||
[+] | Changed | crossroads-stable.tar.gz/xr/webinterface/execute.cc ^ |
@@ -1,11 +1,14 @@ #include "webinterface" +#include "balancer/balancer" void Webinterface::execute() { - int sfd; - Threadlist::desc("Web interface"); // Create the server socket, or retry infinitely. + // This is maybe a too big precaution - previous xr's are responsible + // for killing off their web interfaces. But we don't want a new xr + // start to croak and cause downtime just because the web interface, + // so we just retry for a bit. while (true) { try { msg ("Starting web interface\n"); | ||
[+] | Changed | crossroads-stable.tar.gz/xr/webinterface/webinterface ^ |
@@ -6,11 +6,13 @@ #include "ThreadsAndMutexes/threadlist/threadlist" #include "fdset/fdset" #include "httpbuffer/httpbuffer" -#include "balancer/balancer" class Webinterface: public Thread { public: + Webinterface() { cfd = 0; sfd = 0; } + virtual ~Webinterface(); void execute(); + private: void serve(); void answer(Httpbuffer r); @@ -19,7 +21,7 @@ void answer_blob (string const &b); - int cfd; + int cfd, sfd; }; #endif | ||
[+] | Added | crossroads-stable.tar.gz/xr/webinterface/webinterface1.cc ^ |
@@ -0,0 +1,8 @@ +#include "webinterface" + +Webinterface::~Webinterface() { + if (cfd) { + msg ((Mstr("Stopping web interface socket ") + sfd) + "\n"); + socketclose(sfd); + } +} |