[PATCH 6/7] server: Tighten up parsing of weight string

2013-02-11 Thread Simon Horman
-off-by: Simon Horman ho...@verge.net.au --- src/server.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/server.c b/src/server.c index 4c1762f..98a9fbe 100644 --- a/src/server.c +++ b/src/server.c @@ -164,7 +164,8 @@ const char

[PATCH 5/7] server: Allow relative weights greater than 100%

2013-02-11 Thread Simon Horman
Allow relative weights greater than 100%, capping the absolute value to 256 which is the largest supported absolute weight. Signed-off-by: Simon Horman ho...@verge.net.au --- doc/configuration.txt | 25 + src/server.c |7 ++- 2 files changed, 19

[PATCH 7/7] checks: Add agent health check

2013-02-11 Thread Simon Horman
. option lb-agent-chk server http1_1 10.0.0.10:80 check port 1 weight 100 Signed-off-by: Simon Horman ho...@verge.net.au --- v2 * Rebase - Use server_parse_weight_change_request() instead of process_weight_change_request() and description returned on error. * Remove disable

Re: [PATCH 5/5] dynamic health check

2013-02-04 Thread Simon Horman
On Fri, Feb 01, 2013 at 08:22:24AM +0100, Willy Tarreau wrote: Hi Simon, On Fri, Feb 01, 2013 at 01:56:01PM +0900, Simon Horman wrote: Hi Malcolm, Hi Willy, after a bit of a hiatus I'd like to restart this discussion. Cool, I wanted to ping you on this last week-end but forgot to do

Re: [PATCH 2/5] dumpstats: Break out set weight processing code

2013-01-31 Thread Simon Horman
On Mon, Dec 24, 2012 at 07:58:13AM +0100, Willy Tarreau wrote: Hi Simon, I have some minor comments below for this patch : On Mon, Dec 24, 2012 at 10:33:54AM +0900, Simon Horman wrote: +static int stats_sock_parse_weight_change_request(struct stream_interface *si

Re: [PATCH 3/5] dumpstats: Remove duplicate check in nested if clauses

2013-01-31 Thread Simon Horman
On Mon, Dec 24, 2012 at 07:58:52AM +0100, Willy Tarreau wrote: On Mon, Dec 24, 2012 at 10:33:55AM +0900, Simon Horman wrote: {px-lbprm.algo BE_LB_PROP_DYN) is checked by the immediate outer if clause, so there is no need to check it a second time. Good catch, this one could be merged

Re: [PATCH 5/5] dynamic health check

2013-01-31 Thread Simon Horman
Hi Malcolm, Hi Willy, after a bit of a hiatus I'd like to restart this discussion. On Mon, Dec 24, 2012 at 10:23:15AM +0100, Willy Tarreau wrote: Hi Malcolm, On Mon, Dec 24, 2012 at 09:06:25AM +, Malcolm Turnbull wrote: Willy / Simon, I'm very happy to add a down option, my

[PATCH 0/5] Dynamic Health Check

2012-12-23 Thread Simon Horman
://github.com/horms/haproxy.git dynamic-chk for you to fetch changes up to 6ee39106a01194656240fc0d1f8b651f: dynamic health check (2012-12-24 10:25:08 +0900) Simon Horman (5): dumpstats: Make cli_release_handler() static

[PATCH 1/5] dumpstats: Make cli_release_handler() static

2012-12-23 Thread Simon Horman
Make cli_release_handler() static, it is only used inside dumpstats.c Signed-off-by: Simon Horman ho...@verge.net.au --- src/dumpstats.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dumpstats.c b/src/dumpstats.c index 24de6d0..c79b1d6 100644 --- a/src/dumpstats.c

[PATCH 3/5] dumpstats: Remove duplicate check in nested if clauses

2012-12-23 Thread Simon Horman
{px-lbprm.algo BE_LB_PROP_DYN) is checked by the immediate outer if clause, so there is no need to check it a second time. Signed-off-by: Simon Horman ho...@verge.net.au --- src/dumpstats.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dumpstats.c b/src/dumpstats.c

[PATCH 4/5] Allow relative weights greater than 100%

2012-12-23 Thread Simon Horman
Allow relative weights greater than 100%, capping the absolute value to 256 which is the largest supported absolute weight. Signed-off-by: Simon Horman ho...@verge.net.au --- doc/configuration.txt | 25 + src/dumpstats.c |7 ++- 2 files changed, 19

[PATCH 2/5] dumpstats: Break out set weight processing code

2012-12-23 Thread Simon Horman
Break out set weight processing code. This is in preparation for reusing the code. Signed-off-by: Simon Horman ho...@verge.net.au --- include/proto/dumpstats.h |1 + src/dumpstats.c | 146 ++--- 2 files changed, 87 insertions(+), 60

[PATCH 5/5] dynamic health check

2012-12-23 Thread Simon Horman
to the port of the service, may be useful in conjunction with this option. e.g. option dynamic-chk server http1_1 10.0.0.10:80 check port 1 weight 100 Signed-off-by: Simon Horman ho...@verge.net.au --- include/types/peers.h |1 + include/types/proxy.h |3 ++- src/cfgparse.c

[PATCH] Fix HCHK spelling errors

2012-03-18 Thread Simon Horman
--- include/types/checks.h |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/types/checks.h b/include/types/checks.h index a414630..fd15c95 100644 --- a/include/types/checks.h +++ b/include/types/checks.h @@ -19,7 +19,7 @@ enum { /* Below we have finished

Re: status of master/worker model in 1.5

2011-09-27 Thread Simon Horman
On Mon, Sep 19, 2011 at 12:13:14PM -0400, Adam Kocoloski wrote: Hi all, Simon Horman posted a patch set back in March that enabled haproxy to reload its configuration without refusing connections. I don't think the patches have been merged yet -- are they on track for the 1.5 release

[PATCH 5/5] [MINOR] Use DPRINTF in assign_server()

2011-08-12 Thread Simon Horman
Use DPRINTF in assign_server() rather than open-coding its logic. --- src/backend.c |4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/src/backend.c b/src/backend.c index 2cbc888..31e29d3 100644 --- a/src/backend.c +++ b/src/backend.c @@ -471,9 +471,7 @@ int

[PATCH 1/5] [MEDIUM] Fix stick-table replication on soft-restart

2011-08-12 Thread Simon Horman
[MINOR] session: add a pointer to the new target into the session (664beb8) introduced a regression by changing the type of a peer's target from TARG_TYPE_PROXY to TARG_TYPE_NONE. The effect of this is that during a soft-restart the new process no longer tries to connect to the old process to

[PATCH 2/5] [MEDIUM] Correct ipmask() logic

2011-08-12 Thread Simon Horman
The netmask applied to table entries as configured using ipmask() is stored in arg_p-data.ip not arg_i (which will be 1 if the netmask is set). --- src/pattern.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/pattern.c b/src/pattern.c index e705f00..59ff010 100644

[PATCH 3/5] [MINOR] Correct type in table dump examples

2011-08-12 Thread Simon Horman
When dumping tables the table type is displayed as a type name not an integer. --- doc/configuration.txt | 12 ++-- 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/configuration.txt b/doc/configuration.txt index ffa5c5f..14a4b84 100644 --- a/doc/configuration.txt +++

Re: Thoughts on the master-worker model

2011-07-28 Thread Simon Horman
Hi Willy, sorry for not responding earlier. On Mon, Jul 18, 2011 at 04:40:56PM +0200, Willy Tarreau wrote: Hi Simon ! Last week I could find some time with a quiet place at work to dig again into the master-worker patch series. I went back to what we discussed a few weeks ago concerning

[PATCH 2/6] [MINOR] Consistently free expr on error in cfg_parse_listen()

2011-07-14 Thread Simon Horman
It seems to me that without this change cfg_parse_listen() may leak memory. --- src/cfgparse.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/src/cfgparse.c b/src/cfgparse.c index 145d21f..6e38962 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -2918,6 +2918,7 @@

[PATCH 3/6] [MINOR] Free rdp_cookie_name on denint()

2011-07-14 Thread Simon Horman
The motivation for this is that when soft-restart is merged it will be come more important to free all relevant memory in deinit() Discovered using valgrind. --- src/haproxy.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/haproxy.c b/src/haproxy.c index

[PATCH 0/6] Free memory on exit

2011-07-14 Thread Simon Horman
The motivation for this is that when soft-restart is merged it will be come more important to free all relevant memory in deinit(

[PATCH 1/6] [MINOR] Consistently use error in tcp_parse_tcp_req()

2011-07-14 Thread Simon Horman
It seems to me that without this change tcp_parse_tcp_req() may leak memory. --- src/proto_tcp.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/proto_tcp.c b/src/proto_tcp.c index cdaf150..3b6d39d 100644 --- a/src/proto_tcp.c +++ b/src/proto_tcp.c @@ -1213,7 +1213,7

[PATCH 5/6] [MINOR] Free stick table pool on denint()

2011-07-14 Thread Simon Horman
The motivation for this is that when soft-restart is merged it will be come more important to free all relevant memory in deinit() Discovered using valgrind. --- src/haproxy.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/haproxy.c b/src/haproxy.c index

[PATCH 6/6] [MINOR] Free stick rules on denint()

2011-07-14 Thread Simon Horman
The motivation for this is that when soft-restart is merged it will be come more important to free all relevant memory in deinit() Discovered using valgrind. --- src/haproxy.c | 67 +--- 1 files changed, 54 insertions(+), 13 deletions(-)

Re: [PATCH] [MINOR] Add non-stick server option

2011-06-26 Thread Simon Horman
On Sat, Jun 25, 2011 at 09:15:59PM +0200, Willy Tarreau wrote: Simon, I have applied all of your 4 patches. I really like the idea behind non-stick and stick on the RDP cookie, those are nice improvements. Thanks, I was pretty happy with how it turned out too.

Re: [PATCH] [CLEANUP] Remove unnecessary casts

2011-06-26 Thread Simon Horman
On Sat, Jun 25, 2011 at 09:13:52PM +0200, Willy Tarreau wrote: Hi Simon, On Fri, Jun 24, 2011 at 03:11:37PM +0900, Simon Horman wrote: There is no need to cast when going to or from void * Sometimes the void* is used as an easy cast (this is dirty but handy). This was the case here

[PATCH] [CLEANUP] Remove unnecessary casts

2011-06-24 Thread Simon Horman
There is no need to cast when going to or from void * --- src/proto_tcp.c | 46 +++--- 1 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/proto_tcp.c b/src/proto_tcp.c index f03d3f3..a8540e4 100644 --- a/src/proto_tcp.c +++

[PATCH] [MINOR] Add non-stick server option

2011-06-24 Thread Simon Horman
Never add connections allocated to this sever to a stick-table. This may be used in conjunction with backup to ensure that stick-table persistence is disabled for backup servers. --- doc/configuration.txt |5 + include/types/server.h |1 + src/cfgparse.c |4

[PATCH] [MINOR] Make appsess{,ion}_refresh static

2011-06-23 Thread Simon Horman
apsession_refresh() and apsess_refressh are only used inside apsession.c and thus can be made static. The only use of apsession_refresh() is appsession_task_init(). These functions have been re-ordered to avoid the need for a forward-declaration of apsession_refresh(). ---

[PATCH] [MINOR] Add rdp_cookie pattern fetch function

2011-06-23 Thread Simon Horman
This pattern fetch function extracts the value of the rdp cookie name as a string and uses this value to match. This enables implementation of persistence based on the mstshash cookie. This is typically done if there is no msts cookie present. This differs from balance rdp-cookie in that any

[PATCH 5/5] [MINOR] Add down termination condition

2011-06-21 Thread Simon Horman
If a connection is closed by because the backend became unavailable then log 'D' as the termination condition. Signed-off-by: Simon Horman ho...@verge.net.au --- include/types/session.h |3 ++- src/checks.c|1 + src/log.c |2 +- 3 files changed, 4 insertions

[PATCH 3/5] [MINOR] Add active connection list to server

2011-06-21 Thread Simon Horman
The motivation for this is to allow iteration of all the connections of a server without the expense of iterating over the global list of connections. The first use of this will be to implement an option to close connections associated with a server when is is marked as being down or in

[PATCH 4/5] [MINOR] Allow shutdown of sessions when a server becomes unavailable

2011-06-21 Thread Simon Horman
unless on-marked-down shutdown-sessions is set - fixed logic bug Signed-off-by: Simon Horman ho...@verge.net.au --- doc/configuration.txt |9 + include/proto/session.h |4 ++-- include/types/checks.h |6 ++ include/types/server.h |1 + src/cfgparse.c

[PATCH 1/5] [CLEANUP] peers.h: fix declarations

2011-06-21 Thread Simon Horman
* The declaration of peer_session_create() does not match its definition. As it is only used inside of peers.c make it static. * Make the declaration of peers_register_table() match its definition. * Also, make all functions in peers.c that are not also in peers.h static ---

[PATCH v3 0/4] Allow shutdown of sessions when a server becomes unavailable

2011-06-21 Thread Simon Horman
Hi, this is v3 of this series which adds an option to allow connections to be closed if their backend becomes unavailable. Changes since v2 are: [PATCH 4/5] [MINOR] Allow shutdown of sessions when a server becomes * Rename server element of session as by_srv * Don't close sessions unless

[PATCH 2/5] [CLEANUP] session.c: Make functions static where possible

2011-06-21 Thread Simon Horman
--- include/proto/session.h |3 +- src/session.c | 68 +++--- 2 files changed, 35 insertions(+), 36 deletions(-) diff --git a/include/proto/session.h b/include/proto/session.h index 15f3fe7..c9195f6 100644 --- a/include/proto/session.h +++

[PATCH v4 0/5] Allow shutdown of sessions when a server becomes unavailable

2011-06-21 Thread Simon Horman
Hi, this is v3 of this series which adds an option to allow connections to be closed if their backend becomes unavailable. Changes: v4: [PATCH 5/5] [MINOR] Add down termination condition * Add documentation v3: [PATCH 4/5] [MINOR] Allow shutdown of sessions when a server becomes * Rename

[PATCH 2/5] [CLEANUP] session.c: Make functions static where possible

2011-06-21 Thread Simon Horman
--- include/proto/session.h |3 +- src/session.c | 68 +++--- 2 files changed, 35 insertions(+), 36 deletions(-) diff --git a/include/proto/session.h b/include/proto/session.h index 15f3fe7..c9195f6 100644 --- a/include/proto/session.h +++

[PATCH 4/5] [MINOR] Allow shutdown of sessions when a server becomes unavailable

2011-06-21 Thread Simon Horman
unless on-marked-down shutdown-sessions is set - fixed logic bug Signed-off-by: Simon Horman ho...@verge.net.au --- doc/configuration.txt |9 + include/proto/session.h |4 ++-- include/types/checks.h |6 ++ include/types/server.h |1 + src/cfgparse.c

[PATCH 5/5] [MINOR] Add down termination condition

2011-06-21 Thread Simon Horman
If a connection is closed by because the backend became unavailable then log 'D' as the termination condition. Signed-off-by: Simon Horman ho...@verge.net.au v4 * Document 'D' termination condition --- doc/configuration.txt |2 ++ include/types/session.h |3 ++- src/checks.c

[PATCH 0/9] Enhance show/clear table socat commands

2011-06-15 Thread Simon Horman
Hi, This patch series unifies the arguments taken by the show table and clear table socat commands by allowing: * show table key * clear table data. It also allows non IPv4 keys to be used.

[PATCH 3/9] [MINOR] Break out processing of clear table

2011-06-15 Thread Simon Horman
This will allow the code to be reused for showing a table filtered by key --- src/dumpstats.c | 126 +-- 1 files changed, 66 insertions(+), 60 deletions(-) diff --git a/src/dumpstats.c b/src/dumpstats.c index 309651d..e99153a 100644 ---

[PATCH 4/9] [MINOR] Allow listing of stick table by key

2011-06-15 Thread Simon Horman
--- doc/configuration.txt | 26 -- src/dumpstats.c | 32 +--- 2 files changed, 45 insertions(+), 13 deletions(-) diff --git a/doc/configuration.txt b/doc/configuration.txt index b788c13..5455f7c 100644 --- a/doc/configuration.txt +++

[PATCH 1/9] [CLEANUP] dumpstats: make symbols static where possible

2011-06-15 Thread Simon Horman
--- include/proto/dumpstats.h |9 - src/dumpstats.c | 38 -- 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/include/proto/dumpstats.h b/include/proto/dumpstats.h index 89e656e..850819a 100644 ---

[PATCH 2/9] [MINOR] Break out dumping table

2011-06-15 Thread Simon Horman
This will allow the code to be reused for showing a table filtered by key Signed-off-by: Simon Horman ho...@verge.net.au --- src/dumpstats.c | 315 +-- 1 files changed, 165 insertions(+), 150 deletions(-) diff --git a/src/dumpstats.c b/src

[PATCH 9/9] [MINOR] Allow showing and clearing by key of string stick tables

2011-06-15 Thread Simon Horman
--- doc/configuration.txt |6 -- src/dumpstats.c |4 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/doc/configuration.txt b/doc/configuration.txt index 1d334df..7dfa2b1 100644 --- a/doc/configuration.txt +++ b/doc/configuration.txt @@ -9345,7 +9345,8 @@

[PATCH 7/9] [MINOR] Allow showing and clearing by key of ipv6 stick tables

2011-06-15 Thread Simon Horman
--- doc/configuration.txt |4 ++-- src/dumpstats.c | 16 +++- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/doc/configuration.txt b/doc/configuration.txt index 538be58..00e83f1 100644 --- a/doc/configuration.txt +++ b/doc/configuration.txt @@ -9345,7

[PATCH 6/9] [MINOR] More flexible clearing of stick table

2011-06-15 Thread Simon Horman
* Allow clearing of all entries of a table * Allow clearing of all entries of a table that match a data filter --- doc/configuration.txt | 47 include/proto/dumpstats.h |1 + src/dumpstats.c | 41

[PATCH 8/9] [MINOR] Allow showing and clearing by key of integer stick tables

2011-06-15 Thread Simon Horman
--- doc/configuration.txt |4 ++-- src/dumpstats.c | 29 - 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/doc/configuration.txt b/doc/configuration.txt index 00e83f1..1d334df 100644 --- a/doc/configuration.txt +++ b/doc/configuration.txt @@

[PATCH 5/9] [MINOR] Break out all stick table socat command parsing

2011-06-15 Thread Simon Horman
This will allow reuse for clearing table entries other than by key --- src/dumpstats.c | 150 +++ 1 files changed, 73 insertions(+), 77 deletions(-) diff --git a/src/dumpstats.c b/src/dumpstats.c index bc1c2a4..6adcee2 100644 ---

Re: [PATCH] [MINOR] Allow shutdown of sessions when a server becomes unavailable

2011-06-15 Thread Simon Horman
On Wed, Jun 08, 2011 at 10:55:44AM +0200, Willy Tarreau wrote: [snip] Not necessarily : currently, if you only close on the server side, the effect will be propagated to the client side, so it already does the right thing and at the same time will allow us to improve on this later. Hi Willy,

Re: [PATCH] [MINOR] Allow shutdown of sessions when a server becomes unavailable

2011-06-15 Thread Simon Horman
On Wed, Jun 15, 2011 at 10:03:17PM +0200, Willy Tarreau wrote: On Wed, Jun 15, 2011 at 05:01:32PM +0900, Simon Horman wrote: On Wed, Jun 08, 2011 at 10:55:44AM +0200, Willy Tarreau wrote: [snip] Not necessarily : currently, if you only close on the server side, the effect

[RFC v2 0/4] Allow shutdown of sessions when a server becomes unavailable

2011-06-15 Thread Simon Horman
Hi, I believed this addresses all of the issues raised with the previous version of this change. I have also verified that connections are shutdown a backend is placed in maintenance mode.

[PATCH 1/4] [CLEANUP] peers.h: fix declarations

2011-06-15 Thread Simon Horman
* The declaration of peer_session_create() does not match its definition. As it is only used inside of peers.c make it static. * Make the declaration of peers_register_table() match its definition. * Also, make all functions in peers.c that are not also in peers.h static ---

[PATCH 4/4] [MINOR] Allow shutdown of sessions when a server becomes unavailable

2011-06-15 Thread Simon Horman
--- v2 * Iterate per-server session list instead of global session list in shutdown_sessions() * Set nice level of tasks of sessions to be closed to 1024 * Use TASK_WOKEN_OTHER instead of TASK_WOKEN_RES in shutdown_sessions() As suggested by Willy Tarreau * Use list_for_each_entry_safe()

[PATCH 2/4] [CLEANUP] session.c: Make functions static where possible

2011-06-15 Thread Simon Horman
--- include/proto/session.h |3 +- src/session.c | 68 +++--- 2 files changed, 35 insertions(+), 36 deletions(-) diff --git a/include/proto/session.h b/include/proto/session.h index 15f3fe7..c9195f6 100644 --- a/include/proto/session.h +++

[PATCH 3/4] [MINOR] Add active connection list to server

2011-06-15 Thread Simon Horman
--- include/proto/session.h | 15 +++ include/types/server.h |1 + include/types/session.h |1 + src/cfgparse.c |1 + src/peers.c |2 +- src/proto_http.c|2 +- src/queue.c |3 ++- src/session.c |6 +++---

Re: [RFC v2 0/4] Allow shutdown of sessions when a server becomes unavailable

2011-06-15 Thread Simon Horman
On Thu, Jun 16, 2011 at 07:24:00AM +0200, Willy Tarreau wrote: Hi Simon, On Thu, Jun 16, 2011 at 09:10:37AM +0900, Simon Horman wrote: Hi, I believed this addresses all of the issues raised with the previous version of this change. I have also verified that connections are shutdown

Re: [PATCH] [MINOR] Allow shutdown of sessions when a server becomes unavailable

2011-06-08 Thread Simon Horman
On Wed, Jun 08, 2011 at 10:55:44AM +0200, Willy Tarreau wrote: On Wed, Jun 08, 2011 at 05:00:44PM +0900, Simon Horman wrote: I'm happy with documenting things as you suggest. Fine. Do you have any feeling of how difficult it would be to add a per-server session list

[PATCH] [CLEANUP] peers.h: fix declarations

2011-06-07 Thread Simon Horman
* The declaration of peer_session_create() does not match its definition. As it is only used inside of peers.c make it static. * Make the declaration of peers_register_table() match its definition. * Also, make all functions in peers.c that are not also in peers.h static ---

[PATCH] [CLEANUP] session.c: Make functions static where possible

2011-06-07 Thread Simon Horman
--- include/proto/session.h |3 +- src/session.c | 68 +++--- 2 files changed, 35 insertions(+), 36 deletions(-) diff --git a/include/proto/session.h b/include/proto/session.h index 15f3fe7..c9195f6 100644 --- a/include/proto/session.h +++

[PATCH] [MINOR] Allow shutdown of sessions when a server becomes unavailable

2011-06-07 Thread Simon Horman
--- doc/configuration.txt |9 + include/types/checks.h |6 ++ include/types/server.h |1 + src/cfgparse.c | 14 +- src/checks.c | 22 ++ 5 files changed, 51 insertions(+), 1 deletions(-) diff --git

Re: [PATCH] [MINOR] Allow shutdown of sessions when a server becomes unavailable

2011-06-07 Thread Simon Horman
On Wed, Jun 08, 2011 at 09:19:21AM +0900, Simon Horman wrote: --- doc/configuration.txt |9 + include/types/checks.h |6 ++ include/types/server.h |1 + src/cfgparse.c | 14 +- src/checks.c | 22 ++ 5 files

[PATCH] [CLEANUP] Remove assigned but unused variables

2011-06-06 Thread Simon Horman
--- gcc (Debian 4.6.0-2) 4.6.1 20110329 (prerelease) Copyright (C) 2011 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ... src/proto_http.c:3029:14: warning:

[PATCH] [DOC] Minor spelling fixes and grammatical enhancements

2011-05-29 Thread Simon Horman
--- doc/configuration.txt | 22 +++--- 1 files changed, 11 insertions(+), 11 deletions(-) diff --git a/doc/configuration.txt b/doc/configuration.txt index 2cac152..c074ed4 100644 --- a/doc/configuration.txt +++ b/doc/configuration.txt @@ -7839,7 +7839,7 @@ The list of currently

[GIT PULL horms-rebased7] pidfile fixes

2011-04-12 Thread Simon Horman
: Teach socket_cache about wildcard addresses (2011-04-05 23:01:51 +0200) are available in the git repository at: git://github.com/horms/haproxy.git horms-rebased7 Simon Horman (3): Only write pid file once on startup Close pidfile when it is no longer needed. Always use

[PATCH 2/2] Always use the pidfile returned by prepare()

2011-04-12 Thread Simon Horman
prepare() will open and truncate pidfile if a pid file is to be used. This is a bug which is a hangover from factoring out changes to keep the pidfile open in master processes. Signed-off-by: Simon Horman ho...@verge.net.au --- src/haproxy.c |6 +++--- 1 files changed, 3 insertions(+), 3

Re: [PATCH 0/7] Master/Worker Enhancements

2011-03-28 Thread Simon Horman
On Mon, Mar 28, 2011 at 07:54:16AM +0200, Willy Tarreau wrote: On Mon, Mar 28, 2011 at 02:45:36PM +0900, Simon Horman wrote: On Mon, Mar 28, 2011 at 07:29:12AM +0200, Willy Tarreau wrote: Hi Simon, On Mon, Mar 28, 2011 at 08:49:00AM +0900, Simon Horman wrote: Hi, here

[PATCH 0/7] Master/Worker Enhancements

2011-03-27 Thread Simon Horman
Hi, here is my latest round of patches for the master/worker code that I have been working on to allow haproxy to be restarted without dropping or refusing connections to existing proxies if possible. These patches are available at git://github.com/horms/haproxy.git master They apply

[PATCH 2/7] Reset replacing_workers in create_processes()

2011-03-27 Thread Simon Horman
This reduces the size of main() ever so slightly Signed-off-by: Simon Horman ho...@verge.net.au --- src/haproxy.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/src/haproxy.c b/src/haproxy.c index a84ef49..7f58a43 100644 --- a/src/haproxy.c +++ b/src/haproxy.c

[PATCH 1/7] Remove duplicate call to socket_cache_make_all_available()

2011-03-27 Thread Simon Horman
socket_cache_make_all_available() is also called in init() Signed-off-by: Simon Horman ho...@verge.net.au --- src/haproxy.c |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/src/haproxy.c b/src/haproxy.c index 6dd24c3..a84ef49 100644 --- a/src/haproxy.c +++ b/src

[PATCH 3/7] Reap any children that exited during master restart

2011-03-27 Thread Simon Horman
* Initialised sig_reaper before workers are forked so that it will reap them in they case where they exit very early on Signed-off-by: Simon Horman ho...@verge.net.au --- src/haproxy.c | 35 ++- 1 files changed, 22 insertions(+), 13 deletions(-) diff --git a/src

[PATCH 4/7] Run master as a privileged process

2011-03-27 Thread Simon Horman
CAP_NET_BIND_SERVICE and CAP_SYS_RESOURCE). Signed-off-by: Simon Horman ho...@verge.net.au --- Makefile |8 -- src/haproxy.c | 75 +++- 2 files changed, 10 insertions(+), 73 deletions(-) diff --git a/Makefile b/Makefile index c532f3f

[PATCH 5/7] Add post()

2011-03-27 Thread Simon Horman
post() contains code to be run after all necessary processes have been forked. It includes code that will be run even if no processes are forked. It will be expanded by changes to facilitate the master process running outside the chroot. Signed-off-by: Simon Horman ho...@verge.net.au --- src

[PATCH 7/7] Teach socket_cache about wildcard addresses

2011-03-27 Thread Simon Horman
. Signed-off-by: Simon Horman ho...@verge.net.au --- src/fd.c | 67 + 1 files changed, 58 insertions(+), 9 deletions(-) diff --git a/src/fd.c b/src/fd.c index c2f16bb..2d102c4 100644 --- a/src/fd.c +++ b/src/fd.c @@ -232,22 +232,60

Re: [PATCH 0/7] Master/Worker Enhancements

2011-03-27 Thread Simon Horman
On Mon, Mar 28, 2011 at 07:29:12AM +0200, Willy Tarreau wrote: Hi Simon, On Mon, Mar 28, 2011 at 08:49:00AM +0900, Simon Horman wrote: Hi, here is my latest round of patches for the master/worker code that I have been working on to allow haproxy to be restarted without dropping

[PATCH 3/3] Moving pinging of master into a task

2011-03-14 Thread Simon Horman
Instead of checking that the master still exists every time the main loop loops do so once per second. This should reduce load when there is a lot of activity. --- src/haproxy.c | 37 ++--- 1 files changed, 26 insertions(+), 11 deletions(-) diff --git

[PATCH 0/3] Moving pinging of master into a task

2011-03-14 Thread Simon Horman
/haproxy.git master Simon Horman (3): Move child code out of fork loop Reuse sig_soft_stop() in sig_restart() Moving pinging of master into a task src/haproxy.c | 60 ++-- 1 files changed, 36 insertions(+), 24 deletions(-)

[PATCH 1/3] Move child code out of fork loop

2011-03-14 Thread Simon Horman
This does nothing other than move code somewhere where less indentation is required. This is to make things more readable once more code is added. --- src/haproxy.c | 22 +++--- 1 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/haproxy.c b/src/haproxy.c index

[PATCH 2/3] Reuse sig_soft_stop() in sig_restart()

2011-03-14 Thread Simon Horman
Avoids a small amount of code duplication. --- src/haproxy.c |5 + 1 files changed, 1 insertions(+), 4 deletions(-) diff --git a/src/haproxy.c b/src/haproxy.c index 42d055c..fa740ff 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -296,11 +296,8 @@ void sig_restart(struct sig_handler

[PATCH] Disable master_worker if -d is specified on the command line

2011-03-13 Thread Simon Horman
--- src/haproxy.c |9 ++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/haproxy.c b/src/haproxy.c index 94adcf9..7ff1e82 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -707,9 +707,12 @@ void init(int argc, char **argv)

[PATCH 0/1] Disable master_worker if -d is specified on the command line

2011-03-13 Thread Simon Horman
--- This applies on top of the [PATCH 00/26] Restart of haproxy without dropping connections series that I posted last week. It makes no sense without that series.

Re: [PATCH 00/26] Restart of haproxy without dropping connections

2011-03-13 Thread Simon Horman
On Sun, Mar 13, 2011 at 11:16:33PM +0100, Willy Tarreau wrote: Hi Simon, On Mon, Mar 14, 2011 at 07:05:22AM +0900, Simon Horman wrote: But if it's in the chroot, it can't reread is configuration file. True, I have a slightly dubious way to deal with that. After chrooting

Re: [PATCH 0/1] Disable master_worker if -d is specified on the command line

2011-03-13 Thread Simon Horman
I have added this patch to git://github.com/horms/haproxy.git master On Mon, Mar 14, 2011 at 07:08:45AM +0900, Simon Horman wrote: --- This applies on top of the [PATCH 00/26] Restart of haproxy without dropping connections series that I posted last week. It makes no sense without

Re: [PATCH 00/26] Restart of haproxy without dropping connections

2011-03-13 Thread Simon Horman
On Mon, Mar 14, 2011 at 12:37:17AM +0100, Willy Tarreau wrote: On Mon, Mar 14, 2011 at 07:26:30AM +0900, Simon Horman wrote: Unfortunately I'm not sure of a good alternative to re-opening the file. Keeping the fd open would be way to fragile as editors often create a new file rather than

Re: [PATCH 00/26] Restart of haproxy without dropping connections

2011-03-10 Thread Simon Horman
On Thu, Mar 10, 2011 at 08:46:20AM +0100, Willy Tarreau wrote: On Thu, Mar 10, 2011 at 03:52:58PM +0900, Simon Horman wrote: Wow, I'm impressed, you managed to do that really quickly ! Thanks. Its taken quite a bit of effort to get this far. I have no doubt about

Re: [PATCH 00/26] Restart of haproxy without dropping connections

2011-03-10 Thread Simon Horman
On Thu, Mar 10, 2011 at 09:40:44PM +0100, Willy Tarreau wrote: On Thu, Mar 10, 2011 at 05:40:19PM +0900, Simon Horman wrote: I think that a failure to restart smoothly means that the admin will have to take the decision to restart harder (-sf/-st). Sometimes the scripts will do

[PATCH 04/26] Reap children

2011-03-09 Thread Simon Horman
In the master/worker the workers will be child processes of the master and should be reaped after they exit. --- src/haproxy.c | 11 +++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/src/haproxy.c b/src/haproxy.c index 3fe8889..99d8c0d 100644 --- a/src/haproxy.c +++

[PATCH 02/26] Add a socket cache

2011-03-09 Thread Simon Horman
When a socket is closed, typically because a proxy is deleted, don't close the file descriptor. Rather keep a cache which can be looked-up and used when a subsequent proxy is started. The aim is to avoid unbinding and binding to ports and thus interrupting services unnecessarily. This will be

[PATCH 06/26] Add vAlert and vWarning

2011-03-09 Thread Simon Horman
--- include/proto/log.h | 12 src/log.c | 35 --- 2 files changed, 40 insertions(+), 7 deletions(-) diff --git a/include/proto/log.h b/include/proto/log.h index f2ecf0b..45bec88 100644 --- a/include/proto/log.h +++ b/include/proto/log.h

[PATCH 07/26] Add is_master flag

2011-03-09 Thread Simon Horman
This is in preparation for adding Master/Worker mode --- src/haproxy.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/src/haproxy.c b/src/haproxy.c index 99d8c0d..1f02902 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -136,6 +136,9 @@ struct global global = {

[PATCH 09/26] Clean up logger on deinit()

2011-03-09 Thread Simon Horman
This will allow new logging configuration to take effect once changes to reinitialise haproxy are introduced. --- include/proto/log.h |5 + src/haproxy.c |1 + src/log.c | 17 ++--- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git

[PATCH 12/26] Free global.chroot earlier

2011-03-09 Thread Simon Horman
--- src/haproxy.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/haproxy.c b/src/haproxy.c index dc2739b..8c9053f 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -1131,6 +1131,7 @@ void run(int argc, char **argv) } chdir(/);

[PATCH 14/26] Allow pollers to be initialised multiple times

2011-03-09 Thread Simon Horman
--- src/ev_epoll.c |2 +- src/ev_kqueue.c |1 - src/ev_poll.c |1 - src/ev_select.c |1 - src/ev_sepoll.c |4 +++- 5 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/ev_epoll.c b/src/ev_epoll.c index b976868..f55a382 100644 --- a/src/ev_epoll.c +++

[PATCH 08/26] Conditionally ignore errors when resolving users and groups

2011-03-09 Thread Simon Horman
If is_master is set then the configuration is being read as part a reinitialisation. And as such it seems reasonable to ignore errors when resolving users and groups - if they are unchanged from the original configuration then they will already be set, and otherwise they may not be settable as the

[PATCH 11/26] Move chroot much earlier

2011-03-09 Thread Simon Horman
This allows chroot to occur before setsid_early(). In the case where a master process is re-initialised * It will not chroot itself, though if it is already chrooted that will remain in effect. * If it is already chrooted then the path to the configuration file read during reinitialisation

[PATCH 16/26] Restart master process on SIGUSR2

2011-03-09 Thread Simon Horman
If worker/master mode is active and the master process receives a SIGUSR2 then it will restart haproxy by re-reading the configuration file, killing existing workers and starting new workers. SIGUSR2 is ignored if worker/master mode is not active. SIGUSR2 is ignored by worker processes. ---

[PATCH 22/26] Write pid file if master/worker mode is active

2011-03-09 Thread Simon Horman
If master/worker mode is active then there will be multiple processes present and as such it is useful to know the relevant pids. This also splits run() up into two parts which will aid later refactoring. --- src/haproxy.c | 43 +++ 1 files changed, 27

<    1   2   3   4   >