]> git.ipfire.org Git - thirdparty/haproxy.git/log
thirdparty/haproxy.git
6 years agoMINOR: threads: add a "stuck" flag to the thread_info struct
Willy Tarreau [Wed, 22 May 2019 05:06:44 +0000 (07:06 +0200)] 
MINOR: threads: add a "stuck" flag to the thread_info struct

This flag is constantly cleared by the scheduler and will be set by the
watchdog timer to detect stuck threads. It is also set by the "show
threads" command so that it is easy to spot if the situation has evolved
between two subsequent calls : if the first "show threads" shows no stuck
thread and the second one shows such a stuck thread, it indicates that
this thread didn't manage to make any forward progress since the previous
call, which is extremely suspicious.

6 years agoMINOR: debug: dump streams when an applet, iocb or stream is known
Willy Tarreau [Wed, 22 May 2019 07:43:09 +0000 (09:43 +0200)] 
MINOR: debug: dump streams when an applet, iocb or stream is known

Whenever we can retrieve a valid stream pointer, we now call stream_dump()
to get a detailed dump of the stream currently running on the processor.
This is used by "show threads" and by ha_panic().

6 years agoMINOR: stream: introduce a stream_dump() function and use it in stream_dump_and_crash()
Willy Tarreau [Wed, 22 May 2019 07:33:03 +0000 (09:33 +0200)] 
MINOR: stream: introduce a stream_dump() function and use it in stream_dump_and_crash()

This function dumps a lot of information about a stream into the provided
buffer. It is now used by stream_dump_and_crash() and will be used by the
debugger as well.

6 years agoCLEANUP: debug: make use of ha_tkill() and remove ifdefs
Willy Tarreau [Wed, 22 May 2019 06:46:59 +0000 (08:46 +0200)] 
CLEANUP: debug: make use of ha_tkill() and remove ifdefs

This way we always signal the threads the same way.

6 years agoMINOR: threads: implement ha_tkill() and ha_tkillall()
Willy Tarreau [Wed, 22 May 2019 06:43:34 +0000 (08:43 +0200)] 
MINOR: threads: implement ha_tkill() and ha_tkillall()

These functions are used respectively to signal one thread or all threads.
When multithreading is disabled, it's always the current thread which is
signaled.

6 years agoCLEANUP: debug: always report harmless/want_rdv even without threads
Willy Tarreau [Wed, 22 May 2019 06:52:58 +0000 (08:52 +0200)] 
CLEANUP: debug: always report harmless/want_rdv even without threads

This way we have a more consistent output and we can remove annoying
ifdefs.

6 years agoMINOR: threads: make threads_{harmless|want_rdv}_mask constant 0 without threads
Willy Tarreau [Wed, 22 May 2019 05:48:18 +0000 (07:48 +0200)] 
MINOR: threads: make threads_{harmless|want_rdv}_mask constant 0 without threads

Some code starts to add ifdefs everywhere to work around the lack of
threads_harmless_mask when threads are not compiled in. This one is
often used to indicate a thread having joined the rendez-vous point or
a thread sleeping in the poller. By setting it to zero we translate
what usually is required in debugging code (i.e. the only thread is
currently working) and for signal handlers we can use a combination of
threads_harmless_mask and sleeping_threads_mask to detect the polling
cases as well. Similarly do the same with threads_want_rdv_mask which
is less often used though.

6 years agoCLEANUP: threads: really move thread_info to hathreads.c
Willy Tarreau [Wed, 22 May 2019 04:42:27 +0000 (06:42 +0200)] 
CLEANUP: threads: really move thread_info to hathreads.c

Commit 5a6e2245f ("REORG: threads: move the struct thread_info from
global.h to hathreads.h") didn't hold its promise well, as the thread_info
struct was still declared and initialized in haproxy.c in addition to being
in hathreads.c. Let's move it for real now.

6 years agoMINOR: debug: switch to SIGURG for thread dumps
Willy Tarreau [Wed, 22 May 2019 04:28:54 +0000 (06:28 +0200)] 
MINOR: debug: switch to SIGURG for thread dumps

The current choice of SIGPWR has the adverse effect of stopping gdb each
time it is triggered using "show threads" or example, which is not really
convenient. Let's switch to SIGURG instead, which we don't use either.

6 years agoCLEANUP: objtype: make obj_type() and obj_type_name() take consts
Willy Tarreau [Wed, 22 May 2019 07:30:09 +0000 (09:30 +0200)] 
CLEANUP: objtype: make obj_type() and obj_type_name() take consts

There is no reason for them to require a writable area.

6 years agoBUG/MINOR: mworker: Fix memory leak of mworker_proc members
Tim Duesterhus [Thu, 16 May 2019 18:23:22 +0000 (20:23 +0200)] 
BUG/MINOR: mworker: Fix memory leak of mworker_proc members

The struct mworker_proc is not uniformly freed everywhere, sometimes leading
to leaks of the `id` string (and possibly the other strings).

Introduce a mworker_free_child function instead of duplicating the freeing
logic everywhere to prevent this kind of issues.

This leak was reported in issue #96.

It looks like the leaks have been introduced in commit 9a1ee7ac31c56fd7d881adf2ef4659f336e50c9f,
which is specific to 2.0-dev. Backporting `mworker_free_child` might be
helpful to ease backporting other fixes, though.

6 years agoCLEANUP: time: switch clockid_t to empty_t when not available
Willy Tarreau [Tue, 21 May 2019 17:58:16 +0000 (19:58 +0200)] 
CLEANUP: time: switch clockid_t to empty_t when not available

This is cleaner than using an int. We also get rid of the constants
that we don't need nor use.

6 years agoMINOR: compat: define a new empty type empty_t for non-implemented fields
Willy Tarreau [Tue, 21 May 2019 17:48:44 +0000 (19:48 +0200)] 
MINOR: compat: define a new empty type empty_t for non-implemented fields

Some structures have optional fields which depend on availability of
certain features on certain platforms, and having to stuff lots of
ifdefs in these structs makes them unreadable. Using real values like
ints requires some initialization and adds even more confusion.

Here we take a different approach : we create an empty type called
empty_t to use as a substitute for the real type that is not implemented
and which doesn't contain any value (it's an empty struct). Thus it has
a size of zero but an address, thus a pointer may point to it. It will
not have to be initialized though. Some initialization code might even
continue to work and do nothing like initializing it using memset with
its sizeof which is zero.

6 years agoCLEANUP: time: refine the test on _POSIX_TIMERS
Willy Tarreau [Tue, 21 May 2019 17:46:58 +0000 (19:46 +0200)] 
CLEANUP: time: refine the test on _POSIX_TIMERS

The clock_gettime() man page says we must check that _POSIX_TIMERS is
defined to a value greater than zero, not just that it's simply defined
so let's fix this right now.

6 years agoBUG/MEDIUM: streams: Don't switch from SI_ST_CON to SI_ST_DIS on read0.
Olivier Houchard [Tue, 21 May 2019 15:43:50 +0000 (17:43 +0200)] 
BUG/MEDIUM: streams: Don't switch from SI_ST_CON to SI_ST_DIS on read0.

When we receive a read0, and we're still in SI_ST_CON state (so on an
outgoing conneciton), don't immediately switch to SI_ST_DIS, or, we would
never call sess_establish(), and so the analysers will never run.
Instead, let sess_establish() handle that case, and switch to SI_ST_DIS if
we already have CF_SHUTR on the channel.

This should be backported to 1.9.

6 years agoMAJOR: polling: add event ports support (Solaris)
Emmanuel Hocdet [Mon, 8 Apr 2019 16:53:32 +0000 (16:53 +0000)] 
MAJOR: polling: add event ports support (Solaris)

Event ports are kqueue/epoll polling class for Solaris. Code is based
on https://github.com/joyent/haproxy-1.8/tree/joyent/dev-v1.8.8.
Event ports are available only on SunOS systems derived from
Solaris 10 and later (including illumos systems).

6 years agoBUILD: makefile: remove -fomit-frame-pointer optimisation (solaris)
Emmanuel Hocdet [Fri, 17 May 2019 15:32:21 +0000 (15:32 +0000)] 
BUILD: makefile: remove -fomit-frame-pointer optimisation (solaris)

-fomit-frame-pointer is commonly avoided because tools like dtrace
needs frame-pointer. Remove it from Makefile and let builder's env
do the job.

This patch could be backported to 1.9.

6 years agoBUILD: makefile: use USE_OBSOLETE_LINKER for solaris
Emmanuel Hocdet [Tue, 21 May 2019 09:12:03 +0000 (09:12 +0000)] 
BUILD: makefile: use USE_OBSOLETE_LINKER for solaris

USE_OBSOLETE_LINKER is needed to build on SunOS systems.

This patch must be backported to 1.9.

6 years agoBUILD: threads: only assign the clock_id when supported
Willy Tarreau [Tue, 21 May 2019 13:14:08 +0000 (15:14 +0200)] 
BUILD: threads: only assign the clock_id when supported

I took extreme care to always check for _POSIX_THREAD_CPUTIME before
manipulating clock_id, except at one place (run_thread_poll_loop) as
found by Manu, breaking Solaris. Now fixed, no backport needed.

6 years agoMINOR: debug: report each thread's cpu usage in "show thread"
Willy Tarreau [Mon, 20 May 2019 18:52:20 +0000 (20:52 +0200)] 
MINOR: debug: report each thread's cpu usage in "show thread"

Now we can report each thread's CPU time, both at wake up (poll) and
retrieved while dumping (now), then the difference, which directly
indicates how long the thread has been running uninterrupted. A very
high value for the diff could indicate a deadlock, especially if it
happens between two threads. Note that it may occasionally happen
that a wrong value is displayed since nothing guarantees that the
date is read atomically.

6 years agoMINOR: time: add a function to retrieve another thread's cputime
Willy Tarreau [Mon, 20 May 2019 18:28:34 +0000 (20:28 +0200)] 
MINOR: time: add a function to retrieve another thread's cputime

now_cpu_time_thread() does the same as now_cpu_time() but for another
thread based on its clockid.

6 years agoMINOR: time: move the cpu, mono, and idle time to thread_info
Willy Tarreau [Mon, 20 May 2019 17:24:50 +0000 (19:24 +0200)] 
MINOR: time: move the cpu, mono, and idle time to thread_info

These ones are useful across all threads and would be better placed
in struct thread_info than thread-local. There are very few users.

6 years agoMINOR: threads: add a thread-local thread_info pointer "ti"
Willy Tarreau [Mon, 20 May 2019 16:57:53 +0000 (18:57 +0200)] 
MINOR: threads: add a thread-local thread_info pointer "ti"

Since we're likely to access this thread_info struct more frequently in
the future, let's reserve the thread-local symbol to access it directly
and avoid always having to combine thread_info and tid. This pointer is
set when tid is set.

6 years agoMINOR: threads: always place the clockid in the struct thread_info
Willy Tarreau [Mon, 20 May 2019 18:23:06 +0000 (20:23 +0200)] 
MINOR: threads: always place the clockid in the struct thread_info

It will be easier to deal with the internal API to always have it.

6 years agoMINOR: compat: make sure to always define clockid_t
Willy Tarreau [Mon, 20 May 2019 18:18:26 +0000 (20:18 +0200)] 
MINOR: compat: make sure to always define clockid_t

In order to ease the internal time API, we'll have the threads time always
present even when threads are disabled. Let's make sure clockid_t, and the
minimum clock times are defined even on older or non-compatible systems.

6 years agoREORG: threads: move the struct thread_info from global.h to hathreads.h
Willy Tarreau [Mon, 20 May 2019 16:56:48 +0000 (18:56 +0200)] 
REORG: threads: move the struct thread_info from global.h to hathreads.h

It doesn't make sense to keep this struct thread_info in global.h, it
causes difficulties to access its contents from hathreads.h, let's move
it to the threads where it ought to have been created.

6 years agoREORG: compat: move some integer limit definitions from standard.h to compat.h
Willy Tarreau [Mon, 20 May 2019 17:10:52 +0000 (19:10 +0200)] 
REORG: compat: move some integer limit definitions from standard.h to compat.h

Historically standard.h was the location where we used to (re-)define the
standard set of macros and functions, and to complement the ones missing
on the target OS. Over time it has become a toolbox in itself relying on
many other things, and its definition of LONGBITS is used everywhere else
(e.g. for MAX_THREADS), resulting in painful circular dependencies.

Let's move these few defines (integer sizes) to compat.h where other
similar definitions normally are.

6 years agoMINOR: debug: make ha_panic() report threads starting at 1
Willy Tarreau [Mon, 20 May 2019 15:45:35 +0000 (17:45 +0200)] 
MINOR: debug: make ha_panic() report threads starting at 1

Internally they start at zero but everywhere (config, dumps) we show
them starting at 1, so let's fix the confusion.

6 years agoMINOR: tools: provide a may_access() function and make dump_hex() use it
Willy Tarreau [Mon, 20 May 2019 14:48:20 +0000 (16:48 +0200)] 
MINOR: tools: provide a may_access() function and make dump_hex() use it

It's a bit too easy to crash by accident when using dump_hex() on any
area. Let's have a function to check if the memory may safely be read
first. This one abuses the stat() syscall checking if it returns EFAULT
or not, in which case it means we're not allowed to read from there. In
other situations it may return other codes or even a success if the
area pointed to by the file exists. It's important not to abuse it
though and as such it's tested only once per output line.

6 years agoMINOR: debug/cli: add some debugging commands for developers
Willy Tarreau [Mon, 20 May 2019 12:25:05 +0000 (14:25 +0200)] 
MINOR: debug/cli: add some debugging commands for developers

When haproxy is built with DEBUG_DEV, the following commands are added
to the CLI :

  debug dev close <fd>        : close this file descriptor
  debug dev delay [ms]        : sleep this long
  debug dev exec  [cmd] ...   : show this command's output
  debug dev exit  [code]      : immediately exit the process
  debug dev hex   <addr> [len]: dump a memory area
  debug dev log   [msg] ...   : send this msg to global logs
  debug dev loop  [ms]        : loop this long
  debug dev panic             : immediately trigger a panic
  debug dev tkill [thr] [sig] : send signal to thread

These are essentially aimed at helping developers trigger certain
conditions and are expected to be complemented over time.

6 years agoMINOR: debug: implement ha_panic()
Willy Tarreau [Mon, 20 May 2019 11:48:29 +0000 (13:48 +0200)] 
MINOR: debug: implement ha_panic()

This function dumps all existing threads using the thread dump mechanism
then aborts. This will be used by the lockup detection and by debugging
tools.

6 years agoMINOR: tools: add dump_hex()
Willy Tarreau [Mon, 20 May 2019 14:13:40 +0000 (16:13 +0200)] 
MINOR: tools: add dump_hex()

This is used to dump a memory area into a buffer for debugging purposes.

6 years agoCLEANUP: stream: remove an obsolete debugging test
Willy Tarreau [Mon, 20 May 2019 14:18:13 +0000 (16:18 +0200)] 
CLEANUP: stream: remove an obsolete debugging test

The test consisted in checking that there was always a timeout on a
stream's task and was only enabled when built in development mode,
but 1) it is never tested and 2) if it had been tested it would have
been noticed that it triggers a bit too easily on the CLI. Let's get
rid of this old one.

6 years agoMINOR: threads: add each thread's clockid into the global thread_info
Willy Tarreau [Fri, 3 May 2019 15:21:18 +0000 (17:21 +0200)] 
MINOR: threads: add each thread's clockid into the global thread_info

This is the per-thread CPU runtime clock, it will be used to measure
the CPU usage of each thread and by the lockup detection mechanism. It
must only be retrieved at the beginning of run_thread_poll_loop() since
the thread must already have been started for this. But it must be done
before performing any per-thread initcall so that all thread init
functions have access to the clock ID.

Note that it could make sense to always have this clockid available even
in non-threaded situations and place the process' clock there instead.
But it would add portability issues which are currently easy to deal
with by disabling threads so it may not be worth it for now.

6 years agoMINOR: init/threads: make the global threads an array of structs
Willy Tarreau [Fri, 3 May 2019 08:16:39 +0000 (10:16 +0200)] 
MINOR: init/threads: make the global threads an array of structs

This way we'll be able to store more per-thread information than just
the pthread pointer. The storage became an array of struct instead of
an allocated array since it's very small (typically 512 bytes) and not
worth the hassle of dealing with memory allocation on this. The array
was also renamed thread_info to make its intended usage more explicit.

6 years agoCLEANUP: threads: remove the now unused START_LOCK label
Willy Tarreau [Mon, 20 May 2019 09:14:51 +0000 (11:14 +0200)] 
CLEANUP: threads: remove the now unused START_LOCK label

The last two users are now gone.

6 years agoCLEANUP: memory: make the fault injection code use the OTHER_LOCK label
Willy Tarreau [Mon, 20 May 2019 09:09:00 +0000 (11:09 +0200)] 
CLEANUP: memory: make the fault injection code use the OTHER_LOCK label

The mem_should_fail() function sets a lock while it's building its
messages, and when this was done there was no relevant label available
hence the confusing use of START_LOCK. Now OTHER_LOCK is available for
such use cases, so let's switch to this one instead as START_LOCK is
going to disappear.

6 years agoMEDIUM: init/mworker: make the pipe register function a regular initcall
Willy Tarreau [Mon, 20 May 2019 09:12:15 +0000 (11:12 +0200)] 
MEDIUM: init/mworker: make the pipe register function a regular initcall

Now that we have the guarantee that init calls happen before any other
thread starts, we don't need anymore the workaround installed by commit
1605c7ae6 ("BUG/MEDIUM: threads/mworker: fix a race on startup") and we
can instead rely on a regular per-thread initcall for this function. It
will only be performed on worker thread #0, the other ones and the master
have nothing to do, just like in the original code that was only moved
to the function.

6 years agoMINOR: threads/init: synchronize the threads startup
Willy Tarreau [Mon, 20 May 2019 08:50:43 +0000 (10:50 +0200)] 
MINOR: threads/init: synchronize the threads startup

It's a bit dangerous to let threads initialize at different speeds on
startup. Some are still in their init functions while others area already
running. It was even subject to some race condition bugs like the one
fixed by commit 1605c7ae6 ("BUG/MEDIUM: threads/mworker: fix a race on
startup").

Here in order to secure all this, we take a very simplistic approach
consisting in using half of the rendez-vous point, which is made
exactly for this purpose : we first initialize the mask of the threads
requesting a rendez-vous to the mask of all threads, and we simply call
thread_release() once the init is complete. This guarantees that no
thread will go further than the initialization code during this time.

This could even safely be backported if any other issue related to an
init race was discovered in a stable release.

6 years agoMINOR: init: setenv HAPROXY_CFGFILES
William Lallemand [Mon, 20 May 2019 09:15:37 +0000 (11:15 +0200)] 
MINOR: init: setenv HAPROXY_CFGFILES

Set the HAPROXY_CFGFILES environment variable which contains the list of
configuration files used to start haproxy, separated by semicolon.

6 years agoDOC: fix "successful" typo
Bertrand Jacquin [Thu, 16 May 2019 21:15:31 +0000 (22:15 +0100)] 
DOC: fix "successful" typo

s/succesfull/successful at a few places

6 years agoREGTEST: extend the check duration on tls_health_checks and mark it slow
Willy Tarreau [Fri, 17 May 2019 15:15:20 +0000 (17:15 +0200)] 
REGTEST: extend the check duration on tls_health_checks and mark it slow

Even after commit 1bbc74b55 ("REGTEST: fix tls_health_checks random
failures on MacOS in Travis-CI") which extended it to 100ms, it still
randomly fails on Travis, so let's push it to 500ms and mark it slow.

6 years agoMEDIUM: debug/threads: implement an advanced thread dump system
Willy Tarreau [Fri, 17 May 2019 08:08:49 +0000 (10:08 +0200)] 
MEDIUM: debug/threads: implement an advanced thread dump system

The current "show threads" command was too limited as it was not possible
to dump other threads' detailed states (e.g. their tasks). This patch
goes further by using thread signals so that each thread can dump its
own state in turn into a shared buffer provided by the caller. Threads
are synchronized using a mechanism very similar to the rendez-vous point
and using this method, each thread can safely dump any of its contents
and the caller can finally report the aggregated ones from the buffer.

It is important to keep in mind that the list of signal-safe functions
is limited, so we take care of only using chunk_printf() to write to a
pre-allocated buffer.

This mechanism is enabled by USE_THREAD_DUMP and is enabled by default
on Linux 2.6.28+. On other platforms it falls back to the previous
solution using the loop and the less precise dump.

6 years agoMINOR: stream: detach the stream from its own task on stream_free()
Willy Tarreau [Fri, 17 May 2019 12:20:05 +0000 (14:20 +0200)] 
MINOR: stream: detach the stream from its own task on stream_free()

This makes sure that the stream is not visible from its own task just
before starting to free some of its components. This way we have the
guarantee that a stream found in a task list is totally valid and can
safely be dereferenced.

6 years agoMINOR: task: always reset curr_task when freeing a task or tasklet
Willy Tarreau [Fri, 17 May 2019 12:16:51 +0000 (14:16 +0200)] 
MINOR: task: always reset curr_task when freeing a task or tasklet

With the thread debugger it becomes visible that we can leave some
wandering pointers for a while in curr_task, which is inappropriate.
This patch addresses this by resetting curr_task to NULL before really
freeing the area. This way it becomes safe even regarding signals.

6 years agoMINOR: task: put barriers after each write to curr_task
Willy Tarreau [Fri, 17 May 2019 09:46:04 +0000 (11:46 +0200)] 
MINOR: task: put barriers after each write to curr_task

This one may be watched by signal handlers, we don't want the compiler
to optimize its assignment away at the end of the loop and leave some
wandering pointers there.

6 years agoMINOR: thread: implement ha_thread_relax()
Willy Tarreau [Fri, 17 May 2019 14:33:13 +0000 (16:33 +0200)] 
MINOR: thread: implement ha_thread_relax()

At some places we're using a painful ifdef to decide whether to use
sched_yield() or pl_cpu_relax() to relax in loops, this is hardly
exportable. Let's move this to ha_thread_relax() instead and une
this one only.

6 years agoBUG/MINOR: debug: don't check the call date on tasklets
Willy Tarreau [Fri, 17 May 2019 12:14:35 +0000 (14:14 +0200)] 
BUG/MINOR: debug: don't check the call date on tasklets

tasklets don't have a call date, so when a tasklet is cast into a task
and is present at the end of a page we run a risk of dereferencing
unmapped memory when dumping them in ha_task_dump(). This commit
simplifies the test and uses to distinct calls for tasklets and tasks.
No backport is needed.

6 years agoMINOR: debug: make ha_thread_dump() and ha_task_dump() take a buffer
Willy Tarreau [Fri, 17 May 2019 08:36:08 +0000 (10:36 +0200)] 
MINOR: debug: make ha_thread_dump() and ha_task_dump() take a buffer

Instead of having them dump into the trash and initialize it, let's have
the caller initialize a buffer and pass it. This will be convenient to
dump multiple threads at once into a single buffer.

6 years agoBUG/MINOR: debug: make ha_task_dump() actually dump the requested task
Willy Tarreau [Fri, 17 May 2019 08:34:25 +0000 (10:34 +0200)] 
BUG/MINOR: debug: make ha_task_dump() actually dump the requested task

It used to only dump the current task, which isn't different for now
but the purpose clearly is to dump the requested task. No backport is
needed.

6 years agoBUG/MINOR: debug: make ha_task_dump() always check the task before dumping it
Willy Tarreau [Fri, 17 May 2019 08:39:47 +0000 (10:39 +0200)] 
BUG/MINOR: debug: make ha_task_dump() always check the task before dumping it

For now it cannot happen since we're calling it from a task but it will
break with signals. No backport is needed.

6 years agoBUG/MEDIUM: streams: Try to L7 retry before aborting the connection.
Olivier Houchard [Fri, 17 May 2019 13:40:49 +0000 (15:40 +0200)] 
BUG/MEDIUM: streams: Try to L7 retry before aborting the connection.

In htx_wait_for_response, in case of error, attempt a L7 retry before
aborting the connection if the TX_NOT_FIRST flag is set.
If we don't do that, then we wouldn't attempt L7 retries after the first
request, or if we use HTTP/2, as with HTTP/2 that flag is always set.

6 years agoBUG/MEDIUM: streams: Don't use CF_EOI to decide if the request is complete.
Olivier Houchard [Fri, 17 May 2019 13:38:29 +0000 (15:38 +0200)] 
BUG/MEDIUM: streams: Don't use CF_EOI to decide if the request is complete.

In si_cs_send(), don't check CF_EOI on the request channel to decide if the
request is complete and if we should save the buffer to eventually attempt
L7 retries. The flag may not be set yet, and it may too be set to early,
before we're done modifying the buffer. Instead, get the msg, and make sure
its state is HTTP_MSG_DONE.
That way we will store the request buffer when sending it even in H2.

6 years agoMINOR: cli/debug: add a thread dump function
Willy Tarreau [Thu, 16 May 2019 15:44:30 +0000 (17:44 +0200)] 
MINOR: cli/debug: add a thread dump function

The new function ha_thread_dump() will dump debugging info about all known
threads. The current thread will contain a bit more info. The long-term goal
is to make it possible to use it in signal handlers to improve the accuracy
of some dumps.

The function dumps its output into the trash so as it was trivial to add,
a new "show threads" command appeared on the CLI.

6 years agoMINOR: task: export global_task_mask
Willy Tarreau [Thu, 16 May 2019 15:37:27 +0000 (17:37 +0200)] 
MINOR: task: export global_task_mask

It will be used in debugging functions and must be exported.

6 years agoMINOR: cli/activity: show the dumping thread ID starting at 1
Willy Tarreau [Thu, 16 May 2019 14:19:47 +0000 (16:19 +0200)] 
MINOR: cli/activity: show the dumping thread ID starting at 1

Both the config and gdb report thread IDs starting at 1, so better do the
same in "show activity" to limit confusion. We also display the full
permitted range.

This could be backported to 1.9 since it was present there.

6 years agoDOC: management: place "show activity" at the right place
Willy Tarreau [Thu, 16 May 2019 15:39:32 +0000 (17:39 +0200)] 
DOC: management: place "show activity" at the right place

This time it seems to be me who had trouble with alphabetical ordering.
This should be backported to 1.9.

6 years agoMEDIUM: Make 'resolution_pool_size' directive fatal
Tim Duesterhus [Tue, 14 May 2019 18:57:56 +0000 (20:57 +0200)] 
MEDIUM: Make 'resolution_pool_size' directive fatal

This directive never appeared in a stable release and instead was
introduced and deprecated within 1.8-dev. While it technically could
be outright removed we detect it and error out for good measure.

6 years agoMEDIUM: Make 'option forceclose' actually warn
Tim Duesterhus [Tue, 14 May 2019 18:58:00 +0000 (20:58 +0200)] 
MEDIUM: Make 'option forceclose' actually warn

It is deprecated since 315b39c3914f4c2301ce19a93564566caa2ede50 (1.9-dev),
but only was deprecated in the docs.

Make it warn when being used and remove it from the docs.

6 years agoBUG/MINOR: http_fetch: Rely on the smp direction for "cookie()" and "hdr()"
Christopher Faulet [Thu, 16 May 2019 08:07:30 +0000 (10:07 +0200)] 
BUG/MINOR: http_fetch: Rely on the smp direction for "cookie()" and "hdr()"

A regression was introduced in the commit 89dc49935 ("BUG/MAJOR: http_fetch: Get
the channel depending on the keyword used") on the samples "cookie()" and
"hdr()". Unlike other samples manipulating the HTTP headers, these ones depend
on the sample direction. To fix the bug, these samples use now their own
functions. Depending on the sample direction, they call smp_fetch_cookie() and
smp_fetch_hdr() with the appropriate keyword.

Thanks to Yves Lafon to report this issue.

This patch must be backported wherever the commit 89dc49935 was backported. For
now, 1.9 and 1.8.

6 years agoBUILD: enable freebsd builds on cirrus-ci
Ilya Shipitsin [Tue, 30 Apr 2019 10:33:36 +0000 (15:33 +0500)] 
BUILD: enable freebsd builds on cirrus-ci

6 years ago[RELEASE] Released version 2.0-dev3 v2.0-dev3
Willy Tarreau [Wed, 15 May 2019 14:51:48 +0000 (16:51 +0200)] 
[RELEASE] Released version 2.0-dev3

Released version 2.0-dev3 with the following main changes :
    - BUG/MINOR: peers: Really close the sessions with no heartbeat.
    - CLEANUP: peers: remove useless annoying tabulations.
    - CLEANUP: peers: replace timeout constants by macros.
    - REGTEST: Enable again reg tests with HEAD HTTP method usage.
    - DOC: The option httplog is no longer valid in a backend.
    - DOC: peers: Peers protocol documentation update.
    - REGTEST: remove unexpected "nbthread" statement from Lua test cases
    - BUILD: Makefile: remove 11-years old workarounds for deprecated options
    - BUILD: remove 10-years old error message for obsolete option USE_TCPSPLICE
    - BUILD: Makefile: remove outdated support for dlmalloc
    - BUILD: Makefile: consider a variable's origin and not its value for the options list
    - BUILD: Makefile: also report disabled options in the BUILD_OPTIONS variable
    - BUILD: Makefile: shorten default settings declaration
    - BUILD: Makefile: clean up the target declarations
    - BUILD: report the whole feature set with their status in haproxy -vv
    - BUILD: pass all "USE_*" variables as -DUSE_* to the compiler
    - REGTEST: script: make the script use the new features list
    - REGTEST: script: remove platform-specific assigments of OPTIONS
    - BUG/MINOR: peers: Missing initializations after peer session shutdown.
    - BUG/MINOR: contrib/prometheus-exporter: Fix applet accordingly to recent changes
    - BUILD/MINOR: listener: Silent a few signedness warnings.
    - BUG/MINOR: mux-h1: Only skip invalid C-L headers on output
    - BUG/MEDIUM: mworker: don't free the wrong child when not found
    - BUG/MEDIUM: checks: Don't bother subscribing if we have a connection error.
    - BUG/MAJOR: checks: segfault during tcpcheck_main
    - BUILD: makefile: work around an old bug in GNU make-3.80
    - BUILD: makefile: work around another bug in make 3.80
    - BUILD: http: properly mark some struct as extern
    - BUILD: chunk: properly declare pool_head_trash as extern
    - BUILD: cache: avoid a build warning with some compilers/linkers
    - MINOR: tools: make memvprintf() never pass a NULL target to vsnprintf()
    - MINOR: tools: add an unsetenv() implementation
    - BUILD: re-implement an initcall variant without using executable sections
    - BUILD: use inttypes.h instead of stdint.h
    - BUILD: connection: fix naming of ip_v field
    - BUILD: makefile: fix build of IPv6 header on aix51
    - BUILD: makefile: add _LINUX_SOURCE_COMPAT to build on AIX-51
    - BUILD: define unsetenv on AIX 5.1
    - BUILD: Makefile: disable shared cache on AIX 5.1
    - MINOR: ssl: Add aes_gcm_dec converter
    - REORG: mworker: move serializing functions to mworker.c
    - REORG: mworker: move signals functions to mworker.c
    - REORG: mworker: move IPC functions to mworker.c
    - REORG: mworker: move signal handlers and related functions
    - REORG: mworker: move mworker_cleanlisteners to mworker.c
    - MINOR: mworker: calloc mworker_proc structures
    - MINOR: mworker: don't use children variable anymore
    - MINOR: cli: export cli_parse_default() definition in cli.h
    - REORG: mworker/cli: move CLI functions to mworker.c
    - MEDIUM: mworker-prog: implement program for master-worker
    - MINOR: mworker/cli: show programs in 'show proc'
    - BUG/MINOR: cli: correctly handle abns in 'show cli sockets'
    - MINOR: cli: start addresses by a prefix in 'show cli sockets'
    - MINOR: cli: export HAPROXY_CLI environment variable
    - BUG/MINOR: htx: Preserve empty HTX messages with an unprocessed parsing error
    - BUG/MINOR: proto_htx: Reset to_forward value when a message is set to DONE
    - REGTEST: http-capture/h00000: Relax a regex matching the log message
    - REGTEST: http-messaging/h00000: Fix the test when the HTX is enabled
    - REGTEST: http-rules/h00003: Use a different client for requests expecting a 301
    - REGTEST: log/b00000: Be sure the client always hits its timeout
    - REGTEST: lua/b00003: Relax the regex matching the log message
    - REGTEST: lua/b00003: Specify the HAProxy pid when the command ss is executed
    - BUG/MEDIUM: peers: fix a case where peer session is not cleanly reset on release.
    - BUG/MEDIUM: h2: Don't attempt to recv from h2_process_demux if we subscribed.
    - BUG/MEDIUM: htx: fix random premature abort of data transfers
    - BUG/MEDIUM: streams: Don't remove the SI_FL_ERR flag in si_update_both().
    - BUG/MEDIUM: streams: Store prev_state before calling si_update_both().
    - BUG/MEDIUM: stream: Don't clear the stream_interface flags in si_update_both.
    - MINOR: initcall: Don't forget to define the __start/stop_init_##stg symbols.
    - MINOR: threads: Implement thread_cpus_enabled() for FreeBSD.
    - BUG/MEDIUM: pattern: assign pattern IDs after checking the config validity
    - MINOR: skip get_gmtime where tm is unused
    - MINOR: ssl: Activate aes_gcm_dec converter for BoringSSL
    - BUG/MEDIUM: streams: Only re-run process_stream if we're in a connected state.
    - BUG/MEDIUM: stream_interface: Don't bother doing chk_rcv/snd if not connected.
    - BUG/MEDIUM: task/threads: address a fairness issue between local and global tasks
    - BUG/MINOR: tasks: make sure the first task to be queued keeps its nice value
    - BUG/MINOR: listener: renice the accept ring processing task
    - MINOR: cli/listener: report the number of accepts on "show activity"
    - MINOR: cli/activity: report the accept queue sizes in "show activity"
    - BUG/MEDIUM: spoe: Queue message only if no SPOE applet is attached to the stream
    - BUG/MEDIUM: spoe: Return an error if nothing is encoded for fragmented messages
    - BUG/MINOR: spoe: Be sure to set tv_request when each message fragment is encoded
    - BUG/MEDIUM: htx: Defrag if blocks position is changed and the payloads wrap
    - BUG/MEDIUM: htx: Don't crush blocks payload when append is done on a data block
    - MEDIUM: htx: Deprecate the option 'http-tunnel' and ignore it in HTX
    - MINOR: proto_htx: Don't adjust transaction mode anymore in HTX analyzers
    - BUG/MEDIUM: htx: Fix the process of HTTP CONNECT with h2 connections
    - MINOR: mux-h1: Simplify handling of 1xx responses
    - MINOR: stats/htx: Don't add "Connection: close" header anymore in stats responses
    - MEDIUM: h1: Add an option to sanitize connection headers during parsing
    - MEDIUM: mux-h1: Simplify the connection mode management by sanitizing headers
    - MINOR: mux-h1: Don't release the conn_stream anymore when h1s is destroyed
    - BUG/MINOR: mux-h1: Handle the flag CS_FL_KILL_CONN during a shutdown read/write
    - MINOR: mux-h2: Add a mux_ops dedicated to the HTX mode
    - MINOR: muxes: Add a flag to specify a multiplexer uses the HTX
    - MINOR: stream: Set a flag when the stream uses the HTX
    - MINOR: http: update the macro IS_HTX_STRM() to check the stream flag SF_HTX
    - MINOR: http_fetch/htx: Use stream flags instead of px mode in smp_prefetch_htx
    - MINOR: filters/htx: Use stream flags instead of px mode to instanciate a filter
    - MINOR: muxes: Rely on conn_is_back() during init to handle front/back conn
    - MEDIUM: muxes: Add an optional input buffer during mux initialization
    - MINOR: muxes: Pass the context of the mux to destroy() instead of the connection
    - MEDIUM: muxes: Be prepared to don't own connection during the release
    - MEDIUM: connection: Add conn_upgrade_mux_fe() to handle mux upgrades
    - MEDIUM: htx: Allow the option http-use-htx to be used on TCP proxies too
    - MAJOR: proxy/htx: Handle mux upgrades from TCP to HTTP in HTX mode
    - MAJOR: muxes/htx: Handle inplicit upgrades from h1 to h2
    - MAJOR: htx: Enable the HTX mode by default for all proxies
    - REGTEST: Use HTX by default and add '--no-htx' option to disable it
    - BUG/MEDIUM: muxes: Don't dereference mux context if null in release functions
    - CLEANUP: task: do not export rq_next anymore
    - MEDIUM: tasks: improve fairness between the local and global queues
    - MEDIUM: tasks: only base the nice offset on the run queue depth
    - MINOR: tasks: restore the lower latency scheduling when niced tasks are present
    - BUG/MEDIUM: map: Fix memory leak in the map converter
    - BUG/MINOR: ssl: Fix 48 byte TLS ticket key rotation
    - BUILD: task/thread: fix single-threaded build of task.c
    - BUILD: cli/threads: fix build in single-threaded mode
    - BUG/MEDIUM: muxes: Make sure we unsubcribed when destroying mux ctx.
    - BUG/MEDIUM: h2: Make sure we're not already in the send_list in h2_subscribe().
    - BUG/MEDIUM: h2: Revamp the way send subscriptions works.
    - MINOR: connections: Remove the SUB_CALL_UNSUBSCRIBE flag.
    - BUG/MEDIUM: Threads: Only use the gcc >= 4.7 builtins when using gcc >= 4.7.
    - BUILD: address a few cases of "static <type> inline foo()"
    - BUILD: do not specify "const" on functions returning structs or scalars
    - BUILD: htx: fix a used uninitialized warning on is_cookie2
    - MINOR: peers: Add a new command to the CLI for peers.
    - DOC: update for "show peers" CLI command.
    - BUG/MAJOR: lb/threads: fix insufficient locking on round-robin LB
    - MEDIUM: mworker: store the leaving state of a process
    - MEDIUM: mworker-prog: implements 'option start-on-reload'
    - CLEANUP: mworker: remove the type field in mworker_proc
    - MEDIUM: mworker/cli: export the HAPROXY_MASTER_CLI variable
    - MINOR: cli: don't add a semicolon at the end of HAPROXY_CLI
    - MINOR: mworker: export HAPROXY_MWORKER=1 when running in mworker mode
    - MINOR: init: add a "set-dumpable" global directive to enable core dumps
    - BUG/MINOR: listener/mq: correctly scan all bound threads under low load
    - BUG/MINOR: mworker: mworker_kill should apply on every children
    - BUG/MINOR: mworker: don't exit with an ambiguous value
    - BUG/MINOR: mworker: ensure that we still quits with SIGINT
    - REGTESTS: exclude tests that require ssl, pcre if no such feature is enabled
    - BUG/MINOR: mux-h1: Process input even if the input buffer is empty
    - BUG/MINOR: mux-h1: Don't switch the parser in busy mode if other side has done
    - BUG/MEDIUM: mux-h1: Notify the stream waiting for TCP splicing if ibuf is empty
    - BUG/MEDIUM: mux-h1: Enable TCP splicing to exchange data only
    - MINOR: mux-h1: Handle read0 during TCP splicing
    - BUG/MEDIUM: htx: Don't return the start-line if the HTX message is empty
    - BUG/MAJOR: http_fetch: Get the channel depending on the keyword used
    - BUG/MINOR: http_fetch/htx: Allow permissive sample prefetch for the HTX
    - BUG/MINOR: http_fetch/htx: Use HTX versions if the proxy enables the HTX mode
    - BUG/MEDIUM: tasks: Make sure we set TASK_QUEUED before adding a task to the rq.
    - BUG/MEDIUM: tasks: Make sure we modify global_tasks_mask with the rq_lock.
    - MINOR: tasks: Don't consider we can wake task with tasklet_wakeup().
    - MEDIUM: tasks: No longer use rq.node.leaf_p as a lock.
    - MINOR: tasks: Don't set the TASK_RUNNING flag when adding in the tasklet list.
    - BUG/MEDIUM: applets: Don't use task_in_rq().
    - BUG/MAJOR: task: make sure never to delete a queued task
    - MINOR: task/thread: factor out a wake-up condition
    - CLEANUP: task: remain consistent when using the task's handler
    - MEDIUM: tasks: Merge task_delete() and task_free() into task_destroy().
    - MEDIUM: tasks: Don't account a destroyed task as a runned task.
    - BUG/MINOR: contrib/prometheus-exporter: Fix a typo in the run-queue metric type
    - MINOR: contrib/prometheus-exporter: Remove usless rate metrics
    - MINOR: contrib/prometheus-exporter: Rename some metrics to be more usable
    - MINOR: contrib/prometheus-exporter: Follow best practices about metrics type
    - BUG/MINOR: mworker: disable busy polling in the master process
    - MEDIUM: tasks: Use __ha_barrier_store after modifying global_tasks_mask.
    - MEDIUM: ssl: Give ssl_sock its own context.
    - MEDIUM: connections: Move some fields from struct connection to ssl_sock_ctx.
    - MEDIUM: ssl: provide its own subscribe/unsubscribe function.
    - MEDIUM: connections: Provide a xprt_ctx for each xprt method.
    - MEDIUM: ssl: provide our own BIO.
    - BUILD/medium: ssl: Fix build with OpenSSL < 1.1.0
    - MINOR: peers: adds counters on show peers about tasks calls.
    - MEDIUM: enable travis-ci builds
    - MINOR: fd: Add a counter of used fds.
    - MEDIUM: connections: Add a way to control the number of idling connections.
    - BUG/MEDIUM: maps: only try to parse the default value when it's present
    - BUG/MINOR: acl: properly detect pattern type SMP_T_ADDR
    - REGTEST: Missing REQUIRE_VERSION declarations.
    - MINOR: proto_tcp: tcp-request content: enable set-dst and set-dst-var
    - BUG/MEDIUM: h1: Don't parse chunks CRLF if not enough data are available
    - BUG/MEDIUM: thread/http: Add missing locks in set-map and add-acl HTTP rules
    - BUG/MEDIUM: stream: Don't request a server connection if a shutw was scheduled
    - BUG/MINOR: 51d: Get the request channel to call CHECK_HTTP_MESSAGE_FIRST()
    - BUG/MINOR: da: Get the request channel to call CHECK_HTTP_MESSAGE_FIRST()
    - MINOR: gcc: Fix a silly gcc warning in connect_server()
    - MINOR: ssl/cli: async fd io-handlers printable on show fd
    - Revert "CLEANUP: wurfl: remove dead, broken and unmaintained code"
    - BUILD: add USE_WURFL to the list of known build options
    - MINOR: wurfl: indicate in haproxy -vv the wurfl version in use
    - BUILD: wurfl: build fix for 1.9/2.0 code base
    - CLEANUP: wurfl: removed deprecated methods
    - DOC: wurfl: added point of contact in MAINTAINERS file
    - MINOR: wurfl: enabled multithreading mode
    - MINOR: contrib: dummy wurfl library
    - MINOR: dns: dns_requester structures are now in a memory pool
    - MINOR: dns: move callback affection in dns_link_resolution()
    - MINOR: obj_type: new object type for struct stream
    - MINOR: action: new '(http-request|tcp-request content) do-resolve' action
    - MINOR: log: Extract some code to send syslog messages.
    - REGTEST: replace LEVEL option by a more human readable one.
    - REGTEST: rename the reg test files.
    - REGTEST: adapt some reg tests after renaming.
    - REGTEST: make the "run-regtests" script search for tests in reg-tests by default
    - BUG/MAJOR: stream: Missing DNS context initializations.
    - BUG/MEDIUM: stream: Fix the way early aborts on the client side are handled
    - BUG/MINOR: spoe: Don't systematically wakeup SPOE stream in the applet handler
    - BUG/MEDIUM: ssl: Return -1 on recv/send if we got EAGAIN.
    - BUG/MAJOR: lb/threads: fix AB/BA locking issue in round-robin LB
    - BUG/MAJOR: muxes: Use the HTX mode to find the best mux for HTTP proxies only
    - BUG/MINOR: htx: Exclude TCP proxies when the HTX mode is handled during startup
    - CLEANUP: task: report calls as unsigned in show sess
    - MINOR: tasks/activity: report the context switch and task wakeup rates
    - MINOR: stream: measure and report a stream's call rate in "show sess"
    - MINOR: applet: measure and report an appctx's call rate in "show sess"
    - BUILD: extend Travis CI config to support more platforms
    - REGTEST: exclude osx and generic targets for 40be_2srv_odd_health_checks
    - REGTEST: relax the IPv6 address format checks in converters_ipmask_concat_strcmp_field_word
    - REGTEST: exclude OSX and generic targets from abns_socket.vtc
    - BUILD: travis: remove the "allow_failures" entry
    - BUG/MINOR: activity: always initialize the profiling variable
    - MINOR: activity: make the profiling status per thread and not global
    - MINOR: activity: enable automatic profiling turn on/off
    - CLEANUP: standard: use proper const to addr_to_str() and port_to_str()
    - BUG/MINOR: proto_http: properly reset the stream's call rate on keep-alive
    - MINOR: connection: make the debugging helper functions safer
    - MINOR: stream/debug: make a stream dump and crash function
    - MEDIUM: appctx/debug: force a crash if an appctx spins over itself forever
    - MEDIUM: stream/debug: force a crash if a stream spins over itself forever
    - MEDIUM: streams: measure processing time and abort when detecting bugs
    - BUILD/MEDIUM: contrib: Dummy DeviceAtlas API.
    - MEDIUM: da: HTX mode support.
    - BUG/MEDIUM: mux-h2: properly deal with too large headers frames
    - BUG/MINOR: http: Call stream_inc_be_http_req_ctr() only one time per request
    - BUG/MEDIUM: spoe: arg len encoded in previous frag frame but len changed
    - MINOR: spoe: Use the sample context to pass frag_ctx info during encoding
    - DOC: contrib/modsecurity: Typos and fix the reject example
    - BUG/MEDIUM: contrib/modsecurity: If host header is NULL, don't try to strdup it
    - MINOR: log: Add "sample" new keyword to "log" lines.
    - MINOR: log: Enable the log sampling and load-balancing feature.
    - DOC: log: Document the sampling and load-balancing logging feature.
    - REGTEST: Add a new reg test for log load-balancing feature.
    - BUG/MAJOR: map/acl: real fix segfault during show map/acl on CLI
    - REGTEST: Make this reg test be Linux specific.
    - CLEANUP: task: move the task_per_thread definition to task.h
    - MINOR: activity: report context switch counts instead of rates
    - MINOR: threads: Implement HA_ATOMIC_LOAD().
    - BUG/MEDIUM: port_range: Make the ring buffer lock-free.
    - BUG/MEDIUM: listener: Fix how unlimited number of consecutive accepts is handled
    - MINOR: config: Test validity of tune.maxaccept during the config parsing
    - CLEANUP: config: Don't alter listener->maxaccept when nbproc is set to 1
    - BUG/MEDIUM: servers: fix typo "src" instead of "srv"
    - BUG/MEDIUM: ssl: Don't pretend we can retry a recv/send if we got a shutr/w.
    - BUG/MINOR: haproxy: fix rule->file memory leak
    - BUG/MINOR: log: properly free memory on logformat parse error and deinit()
    - BUG/MINOR: checks: free memory allocated for tasklets
    - BUG/MEDIUM: pattern: fix memory leak in regex pattern functions
    - BUG/MEDIUM: channels: Don't forget to reset output in channel_erase().
    - BUG/MEDIUM: connections: Make sure we remove CO_FL_SESS_IDLE on disown.
    - MINOR: threads: flatten the per-thread cpu-map
    - MINOR: init/threads: remove the useless tids[] array
    - MINOR: init/threads: make the threads array global
    - BUG/MEDIUM: ssl: Use the early_data API the right way.
    - BUG/MEDIUM: streams: Don't add CF_WRITE_ERROR if early data were rejected.
    - MEDIUM: streams: Add the ability to retry a request on L7 failure.
    - MEDIUM: streams: Add a way to replay failed 0rtt requests.
    - MEDIUM: streams: Add a new keyword for retry-on, "junk-response"
    - BUG/MINOR: stream: also increment the retry stats counter on L7 retries
    - BUG/MEDIUM: checks: make sure the warmup task takes the server lock
    - BUG/MINOR: logs/threads: properly split the log area upon startup
    - BUILD: extend travis-ci matrix
    - CLEANUP: Remove appsession documentation
    - DOC: Fix typo in keyword matrix
    - BUILD: remove "build_libressl" duplicate declaration
    - BUILD: travis-ci: get back to osx without openssl support
    - BUILD: enable several LibreSSL hacks, including
    - BUILD: temporarily mark LibreSSL builds as allowed to fail
    - BUILD: travis: TMPDIR replacement.
    - BUG/MEDIUM: ssl: Don't attempt to use early data with libressl.
    - MINOR: doc: Document allow-0rtt on the server line.
    - MINOR: doc: Document the interaction of allow-0rtt and retry-on 0rtt-rejected.
    - MEDIUM: proto: Change the prototype of the connect() method.
    - MEDIUM: tcp: add the "tfo" option to support TCP fastopen on the server
    - MINOR: config: Extract the code of "stick-table" line parsing.
    - BUILD/MINOR: stick-table: Compilation fix.
    - MEDIUM: stick-table: Stop handling stick-tables as proxies.
    - MINOR: stick-tables: Add peers process binding computing.
    - MINOR: stick-table: Add prefixes to stick-table names.
    - MINOR: peers: Do not emit global stick-table names.
    - DOC: Update for "table" lines in "peers" section.
    - REGTEST: Add reg tests for "table" lines in "peers" sections.
    - MEDIUM: regex: modify regex_comp() to atomically allocate/free the my_regex struct
    - REGTEST: make the tls_health_checks test much faster
    - REGTEST: make the "table in peers" test require v2.0
    - BUG/MINOR: mux-h2: rely on trailers output not input to turn them to empty data
    - BUG/MEDIUM: h2/htx: always fail on too large trailers
    - MEDIUM: mux-h2: discard contents that are to be sent after a shutdown
    - BUG/MEDIUM: mux-h2/htx: never wait for EOM when processing trailers
    - BUG/MEDIUM: h2/htx: never leave a trailers block alone with no EOM block
    - REGTEST: Flag some slow reg tests.
    - REGTEST: Reg tests file renaming.
    - REGTEST: Wrong renaming for one reg test.
    - REGTEST: Wrong assumption in IP:port logging test.
    - BUG/MINOR: mworker/ssl: close OpenSSL FDs on reload
    - MINOR: systemd: Use the variables from /etc/default/haproxy
    - MINOR: systemd: Make use of master socket in systemd unit
    - MINOR: systemd: support /etc/sysconfig/ for redhat based distrib
    - BUG/MEDIUM: stick-table: fix regression caused by a change in proxy struct
    - BUG/MEDIUM: tasks: fix possible segfault on task_destroy()
    - CLEANUP: task: remove unneeded tests before task_destroy()
    - MINOR: mworker: support a configurable maximum number of reloads
    - BUG/MINOR: mux-h2: fix the condition to close a cs-less h2s on the backend
    - BUG/MEDIUM: spoe: Be sure the sample is found before setting its context
    - BUG/MINOR: mux-h1: Fix the parsing of trailers
    - BUG/MINOR: htx: Never transfer more than expected in htx_xfer_blks()
    - MINOR: htx: Split on DATA blocks only when blocks are moved to an HTX message
    - MINOR: htx: Don't try to append a trailer block with the previous one
    - MINOR: htx: Remove support for unused OOB HTX blocks
    - BUILD: travis-ci bugfixes and improvements
    - BUG/MEDIUM: servers: Don't use the same srv flag for cookie-set and TFO.
    - BUG/MEDIUM: h2: Make sure we set send_list to NULL in h2_detach().
    - BUILD: ssl: fix again a libressl build failure after the openssl FD leak fix
    - CLEANUP: ssl-sock: use HA_OPENSSL_VERSION_NUMBER instead of OPENSSL_VERSION_NUMBER
    - BUILD: ssl: make libressl use its own version numbers
    - CLEANUP: ssl: remove 57 occurrences of useless tests on LIBRESSL_VERSION_NUMBER
    - MINOR: ssl: enable aes_gcm_dec on LibreSSL
    - BUILD: ssl: fix libressl build again after aes-gcm-enc
    - REORG: ssl: move openssl-compat from proto to common
    - REORG: ssl: move some OpenSSL defines from ssl_sock to openssl-compat
    - CLEANUP: ssl: never include openssl/*.h outside of openssl-compat.h anymore
    - CLEANUP: ssl: make inclusion of openssl headers safe
    - BUILD: add BoringSSL to travis-ci build matrix
    - BUILD: threads: Add __ha_cas_dw fallback for single threaded builds
    - BUG/MINOR: stream: Attach the read side on the response as soon as possible
    - BUG/MEDIUM: http: Use pointer to the begining of input to parse message headers
    - BUG/MEDIUM: h2: Don't check send_wait to know if we're in the send_list.
    - BUG/MEDIUM: streams: Make sur SI_FL_L7_RETRY is set before attempting a retry.
    - MEDIUM: streams: Add a new http action, disable-l7-retry.
    - MINOR: streams: Introduce a new retry-on keyword, all-retryable-errors.
    - BUG/MINOR: vars: Fix memory leak in vars_check_arg
    - BUILD: travis-ci: make TMPDIR global variable in travis-ci
    - CLEANUP: ssl: move the SSL_OP_* and SSL_MODE_* definitions to openssl-compat
    - CLEANUP: ssl: remove ifdef around SSL_CTX_get_extra_chain_certs()
    - CLEANUP: ssl: move all BIO_* definitions to openssl-compat
    - BUILD: threads: fix again the __ha_cas_dw() definition
    - BUG/MAJOR: mux-h2: do not add a stream twice to the send list
    - Revert "BUG/MINOR: vars: Fix memory leak in vars_check_arg"
    - BUG/MINOR: peers: Fix memory leak in cfg_parse_peers
    - BUG/MINOR: htx: make sure to always initialize the HTTP method when parsing a buffer
    - REGTEST: fix tls_health_checks random failures on MacOS in Travis-CI
    - MINOR: spoe: Set the argument chunk size to 0 when SPOE variables are checked
    - BUG/MINOR: vars: Fix memory leak in vars_check_arg
    - BUG/MAJOR: ssl: segfault upon an heartbeat request
    - MINOR: spoa-server: Clone the v1.7 spoa-example project
    - MINOR: spoa-server: move some definition from spoa_server.c to spoa_server.h
    - MINOR: spoa-server: Externalise debug functions
    - MINOR: spoe-server: rename "worker" functions
    - MINOR: spoa-server: Replace the thread init system by processes
    - MINOR: spoa-server: With debug mode, start only one process
    - MINOR: spoa-server: Allow registering external processes
    - MINOR: spoa-server: Allow registering message processors
    - MINOR: spoa-server: Load files
    - MINOR: spoa-server: Prepare responses
    - MINOR: spoa-server: Execute registered callbacks
    - MINOR: spoa-server: Add Lua processing
    - MINOR: spoa-server: Add python
    - MINOR/DOC: spoe-server: Add documentation
    - BUG/MEDIUM: connections: Don't forget to set xprt_ctx to NULL on close.
    - MINOR: lists: add LIST_ADDED() to check if an element belongs to a list
    - CLEANUP: mux-h2: use LIST_ADDED() instead of LIST_ISEMPTY() where relevant
    - MINOR: mux-h2: add two H2S flags to report the need for shutr/shutw
    - CLEANUP: mux-h2: simply use h2s->flags instead of ret in h2_deferred_shut()
    - CLEANUP: connection: remove the handle field from the wait_event struct
    - BUG/MINOR: log: Wrong log format initialization.
    - BUG/MINOR: mux-h2: make the do_shut{r,w} functions more robust against retries
    - BUG/MINOR: mworker: use after free when the PID not assigned
    - MINOR: mux-h2: remove useless test on stream ID vs last in wake function
    - MINOR: mux-h2: make h2_wake_some_streams() not depend on the CS flags
    - MINOR: mux-h2: make h2s_wake_one_stream() the only function to deal with CS
    - MINOR: mux-h2: make h2s_wake_one_stream() not depend on temporary CS flags
    - BUG/MINOR: mux-h2: make sure to honor KILL_CONN in do_shut{r,w}
    - CLEANUP: mux-h2: don't test for impossible CS_FL_REOS conditions
    - MINOR: mux-h2: add macros to check multiple stream states at once
    - MINOR: mux-h2: stop relying on CS_FL_REOS
    - BUG/MEDIUM: mux-h2: Set EOI on the conn_stream during h2_rcv_buf()
    - BUILD: debug: make gcc not complain on the ABORT_NOW() macro
    - MINOR: debug: add a new BUG_ON macro
    - MINOR: h2: Use BUG_ON() to enforce rules in subscribe/unsubscribe.
    - MINOR: h1: Use BUG_ON() to enforce rules in subscribe/unsubscribe.
    - MINOR: connections: Use BUG_ON() to enforce rules in subscribe/unsubscribe.
    - BUILD: ist: turn the lower/upper case tables to literal on obsolete linkers

6 years agoBUILD: ist: turn the lower/upper case tables to literal on obsolete linkers
Willy Tarreau [Wed, 15 May 2019 14:07:36 +0000 (16:07 +0200)] 
BUILD: ist: turn the lower/upper case tables to literal on obsolete linkers

Gil Bahat reported build issues on Cygwin starting with 1.9 due to a
difference in the way the linker handles the weak symbols there,
causing multiple declarations of ist_lc[] and ist_uc[]. It's likely
that this issue could also happen on any older or non-ELF linker.

This patch addresses this by using literals instead on such platforms,
leaving it to the compiler to merge the constants when it can. On other
platforms the resulting executable is slightly larger due to strings
that could not be merged but this is a minor detail compared to not
being able to build at all.

If this change alone is confirmed to fix these issues, it's safe to
backport to 1.9.

6 years agoMINOR: connections: Use BUG_ON() to enforce rules in subscribe/unsubscribe.
Olivier Houchard [Tue, 14 May 2019 16:02:47 +0000 (18:02 +0200)] 
MINOR: connections: Use BUG_ON() to enforce rules in subscribe/unsubscribe.

It is not legal to subscribe if we're already subscribed, or to unsubscribe
if we did not subscribe, so instead of trying to handle those cases, just
assert that it's ok using the new BUG_ON() macro.

6 years agoMINOR: h1: Use BUG_ON() to enforce rules in subscribe/unsubscribe.
Olivier Houchard [Tue, 14 May 2019 16:02:23 +0000 (18:02 +0200)] 
MINOR: h1: Use BUG_ON() to enforce rules in subscribe/unsubscribe.

It is not legal to subscribe if we're already subscribed, or to unsubscribe
if we did not subscribe, so instead of trying to handle those cases, just
assert that it's ok using the new BUG_ON() macro.

6 years agoMINOR: h2: Use BUG_ON() to enforce rules in subscribe/unsubscribe.
Olivier Houchard [Tue, 14 May 2019 15:50:32 +0000 (17:50 +0200)] 
MINOR: h2: Use BUG_ON() to enforce rules in subscribe/unsubscribe.

It is not legal to subscribe if we're already subscribed, or to unsubscribe
if we did not subscribe, so instead of trying to handle those cases, just
assert that it's ok using the new BUG_ON() macro.

6 years agoMINOR: debug: add a new BUG_ON macro
Willy Tarreau [Tue, 14 May 2019 15:27:52 +0000 (17:27 +0200)] 
MINOR: debug: add a new BUG_ON macro

We do have some code paths testing for impossible errors that tend to
be quite confusing, first for maintenance (what to do on such errors,
and how far to guess the bug), second for developers as it tends to
hide the main purpose and expectations of these call places. Also
most of the time impossible errors are ignored by the callers so the
tests are not even usable during debugging.

Let's instead implement a BUG_ON macro which takes a condition, which
if true, will cause a message to be emitted and optionally to crash the
process. Additionally, these calls inserted at various places server as
hints and documentation for developers to know that such conditions
must absolutely not happen.

This is only enabled when DEBUG_STRICT or DEBUG_STRICT_NOCRASH are set.
As its name implies, DEBUG_STRICT_NOCRASH only performs the test but
does not crash, which can be useful to track some checkpoints.

At the moment nothing uses this code.

6 years agoBUILD: debug: make gcc not complain on the ABORT_NOW() macro
Willy Tarreau [Tue, 14 May 2019 15:22:28 +0000 (17:22 +0200)] 
BUILD: debug: make gcc not complain on the ABORT_NOW() macro

On recent gcc versions with the null-deref checks, ABORT_NOW() rightfully
emits such a warning. But here it's on purpose. Simply changing the memory
address to 1 makes gcc happy.

6 years agoBUG/MEDIUM: mux-h2: Set EOI on the conn_stream during h2_rcv_buf()
Christopher Faulet [Tue, 7 May 2019 08:55:17 +0000 (10:55 +0200)] 
BUG/MEDIUM: mux-h2: Set EOI on the conn_stream during h2_rcv_buf()

Just like CS_FL_REOS previously, the CS_FL_EOI flag is abused as a proxy
for H2_SF_ES_RCVD. The problem is that this flag is consumed by the
application layer and is set immediately when an end of stream was met,
which is too early since the application must retrieve the rxbuf's
contents first. The effect is that some transfers are truncated (mostly
the first one of a connection in most tests).

The problem of mixing CS flags and H2S flags in the H2 mux is not new
(and is currently being addressed) but this specific one was emphasized
in commit 63768a63d ("MEDIUM: mux-h2: Don't mix the end of the message
with the end of stream") which was backported to 1.9. Note that other
flags, particularly CS_FL_REOS still need to be asynchronously reported,
though their impact seems more limited for now.

This patch makes sure that all internal uses of CS_FL_EOI are replaced
with a test on H2_SF_ES_RCVD (as there is a 1-to-1 equivalence) and that
CS_FL_EOI is only reported once the rxbuf is empty.

This should ideally be backported to 1.9 unless it causes too much
trouble due to the recent changes in this area, as 1.9 *seems* not
to be directly affected by this bug.

6 years agoMINOR: mux-h2: stop relying on CS_FL_REOS
Willy Tarreau [Tue, 14 May 2019 09:46:28 +0000 (11:46 +0200)] 
MINOR: mux-h2: stop relying on CS_FL_REOS

This flag was introduced early in 1.9 development (a3f7efe00) to report
the fact that the rxbuf that was present on the conn_stream was followed
by a shutr. Since then the rxbuf moved from the conn_stream to the h2s
(638b799b0) but the flag remained on the conn_stream. It is problematic
because some state transitions inside the mux depend on it, thus depend
on the CS, and as such have to test for its existence before proceeding.

This patch replaces the test on CS_FL_REOS with a test on the only
states that set this flag (H2_SS_CLOSED, H2_SS_HREM, H2_SS_ERROR).
The few places where the flag was set were removed (the flag is not
used by the data layer).

6 years agoMINOR: mux-h2: add macros to check multiple stream states at once
Willy Tarreau [Tue, 14 May 2019 09:44:03 +0000 (11:44 +0200)] 
MINOR: mux-h2: add macros to check multiple stream states at once

At many places we need to test for several stream states at once, let's
have macros to make a bit mask from a state to ease this.

6 years agoCLEANUP: mux-h2: don't test for impossible CS_FL_REOS conditions
Willy Tarreau [Tue, 14 May 2019 09:31:00 +0000 (11:31 +0200)] 
CLEANUP: mux-h2: don't test for impossible CS_FL_REOS conditions

This flag is currently set when an incoming close was received, which
results in the stream being in either H2_SS_HREM, H2_SS_CLOSED, or
H2_SS_ERROR states, so let's remove the test for the OPEN and HLOC
cases.

6 years agoBUG/MINOR: mux-h2: make sure to honor KILL_CONN in do_shut{r,w}
Willy Tarreau [Tue, 14 May 2019 08:44:40 +0000 (10:44 +0200)] 
BUG/MINOR: mux-h2: make sure to honor KILL_CONN in do_shut{r,w}

If the stream closes and quits while there's no room in the mux buffer
to send an RST frame, next time it is attempted it will not lead to
the connection being closed because the conn_stream will have been
released and the KILL_CONN flag with it as well.

This patch reserves a new H2_SF_KILL_CONN flag that is copied from
the CS when calling shut{r,w} so that the stream remains autonomous
on this even when the conn_stream leaves.

This should ideally be backported to 1.9 though it depends on several
previous patches that may or may not be suitable for backporting. The
severity is very low so there's no need to insist in case of trouble.

6 years agoMINOR: mux-h2: make h2s_wake_one_stream() not depend on temporary CS flags
Willy Tarreau [Tue, 7 May 2019 15:48:59 +0000 (17:48 +0200)] 
MINOR: mux-h2: make h2s_wake_one_stream() not depend on temporary CS flags

In h2s_wake_one_stream() we used to rely on the temporary flags used to
adjust the CS to determine the new h2s state. This really is not convenient
and creates far too many dependencies. This commit just moves the same
condition to the places where the temporary flags were set so that we
don't have to rely on these anymore. Whether these are relevant or not
was not the subject of the operation, what matters was to make sure the
conditions to adjust the stream's state and the CS's flags remain the
same. Later it could be studied if these conditions are correct or not.

6 years agoMINOR: mux-h2: make h2s_wake_one_stream() the only function to deal with CS
Willy Tarreau [Tue, 7 May 2019 15:26:05 +0000 (17:26 +0200)] 
MINOR: mux-h2: make h2s_wake_one_stream() the only function to deal with CS

h2s_wake_one_stream() has access to all the required elements to update
the connstream's flags and figure the necessary state transitions, so
let's move the conditions there from h2_wake_some_streams().

6 years agoMINOR: mux-h2: make h2_wake_some_streams() not depend on the CS flags
Willy Tarreau [Tue, 7 May 2019 13:23:14 +0000 (15:23 +0200)] 
MINOR: mux-h2: make h2_wake_some_streams() not depend on the CS flags

It's problematic to have to pass some CS flags to this function because
that forces some h2s state transistions to update them just in time
while some of them are supposed to only be updated during I/O operations.

As a first step this patch transfers the decision to pass CS_FL_ERR_PENDING
from the caller to the leaf function h2s_wake_one_stream(). It is easy
since this is the only flag passed there and it depends on the position of
the stream relative to the last_sid if it was set.

6 years agoMINOR: mux-h2: remove useless test on stream ID vs last in wake function
Willy Tarreau [Tue, 7 May 2019 12:44:41 +0000 (14:44 +0200)] 
MINOR: mux-h2: remove useless test on stream ID vs last in wake function

h2_wake_some_streams() first looks up streams whose IDs are greater than
or equal to last+1, then checks if the id is lower than or equal to last,
which by definition will never match. Let's remove this confusing leftover
from ancient code.

6 years agoBUG/MINOR: mworker: use after free when the PID not assigned
William Lallemand [Tue, 14 May 2019 09:15:18 +0000 (11:15 +0200)] 
BUG/MINOR: mworker: use after free when the PID not assigned

Commit 4528611 ("MEDIUM: mworker: store the leaving state of a process")
introduced a bug in the mworker_env_to_proc_list() function.

This is very unlikely to occur since the PID should always be assigned.
It can probably happen if the environment variable is corrupted.

No backport needed.

6 years agoBUG/MINOR: mux-h2: make the do_shut{r,w} functions more robust against retries
Willy Tarreau [Tue, 14 May 2019 08:40:21 +0000 (10:40 +0200)] 
BUG/MINOR: mux-h2: make the do_shut{r,w} functions more robust against retries

These functions may fail to emit an RST or an empty DATA frame because
the mux is full or busy. Then they subscribe the h2s and try again.
However when doing so, they will already have marked the error state on
the stream and will not pass anymore through the sequence resulting in
the failed frame to be attempted to be sent again nor to the close to
be done, instead they will return a success.

It is important to only leave when the stream is already closed, but
to go through the whole sequence otherwise.

This patch should ideally be backported to 1.9 though it's possible that
the lack of the WANT_SHUT* flags makes this difficult or dangerous. The
severity is low enough to avoid this in case of trouble.

6 years agoBUG/MINOR: log: Wrong log format initialization.
Frédéric Lécaille [Tue, 14 May 2019 08:57:58 +0000 (10:57 +0200)] 
BUG/MINOR: log: Wrong log format initialization.

This patch fixes an issue introduced by 0bad840b commit
"MINOR: log: Extract some code to send syslog messages" which leaded
to wrong log format variable initializations at least for "short" and "raw" format.
This commit skipped the cases where even if passed to __do_send_log(), the
syslog tag and syslog pid string must not be used to format the log message
with "short" and "raw". This is done iniatilizing "tag_max" and "pid_max"
variables (the lengths of the tag and pid strings) to 0, then updating to them to
the length of the tag and pid strings passed as variables to __do_send_log()
depending on the log format and in every cases using this length for the iovec
variable used to send() the log.

This bug is specific to 2.0.

6 years agoCLEANUP: connection: remove the handle field from the wait_event struct
Willy Tarreau [Mon, 13 May 2019 16:27:59 +0000 (18:27 +0200)] 
CLEANUP: connection: remove the handle field from the wait_event struct

It was only set and not consumed after the previous change. The reason
is that the task's context always contains the relevant information,
so there is no need for a second pointer.

6 years agoCLEANUP: mux-h2: simply use h2s->flags instead of ret in h2_deferred_shut()
Willy Tarreau [Mon, 13 May 2019 16:17:53 +0000 (18:17 +0200)] 
CLEANUP: mux-h2: simply use h2s->flags instead of ret in h2_deferred_shut()

This one used to rely on the combined return statuses of the shutr/w
functions but now that we have the H2_SF_WANT_SHUT{R,W} flags we don't
need this anymore if we properly remove these flags after their operations
succeed. This is what this patch does.

6 years agoMINOR: mux-h2: add two H2S flags to report the need for shutr/shutw
Willy Tarreau [Mon, 13 May 2019 16:06:17 +0000 (18:06 +0200)] 
MINOR: mux-h2: add two H2S flags to report the need for shutr/shutw

Currently when a shutr/shutw fails due to lack of buffer space, we abuse
the wait_event's handle pointer to place up to two bits there in addition
to the original pointer. This pointer is not used for anything but this
and overall the intent becomes clearer with h2s flags than with these
two alien bits in the pointer, so let's use clean flags now.

6 years agoCLEANUP: mux-h2: use LIST_ADDED() instead of LIST_ISEMPTY() where relevant
Willy Tarreau [Mon, 13 May 2019 15:56:11 +0000 (17:56 +0200)] 
CLEANUP: mux-h2: use LIST_ADDED() instead of LIST_ISEMPTY() where relevant

Lots of places were using LIST_ISEMPTY() to detect if a stream belongs
to one of the send lists or to detect if a connection was already
waiting for a buffer or attached to an idle list. Since these ones are
not list heads but list elements, let's use LIST_ADDED() instead.

6 years agoMINOR: lists: add LIST_ADDED() to check if an element belongs to a list
Willy Tarreau [Mon, 13 May 2019 15:48:46 +0000 (17:48 +0200)] 
MINOR: lists: add LIST_ADDED() to check if an element belongs to a list

Some code parts use LIST_ISEMPTY() a lot on list elements to detect
if they were reset consecutive to their removal from a list, but this
test is always confusing as this was initially designed for list heads.

Instead let's have a new macro, LIST_ADDED(), which returns true when
the element is in a list (i.e. it's not "empty").

6 years agoBUG/MEDIUM: connections: Don't forget to set xprt_ctx to NULL on close.
Olivier Houchard [Mon, 13 May 2019 17:10:46 +0000 (19:10 +0200)] 
BUG/MEDIUM: connections: Don't forget to set xprt_ctx to NULL on close.

In conn_xprt_close(), after calling xprt->close(), don't forget to set
conn->xprt_ctx to NULL, or we may attempt to reuse the now-free'd
conn->xprt_ctx if the connection failed and we're retrying it.

6 years agoMINOR/DOC: spoe-server: Add documentation
Thierry FOURNIER [Sun, 25 Feb 2018 20:28:05 +0000 (21:28 +0100)] 
MINOR/DOC: spoe-server: Add documentation

This is the documentation and examples.

6 years agoMINOR: spoa-server: Add python
Thierry FOURNIER [Sun, 25 Feb 2018 19:59:57 +0000 (20:59 +0100)] 
MINOR: spoa-server: Add python

This commit adds the Python support for the server.

6 years agoMINOR: spoa-server: Add Lua processing
Thierry FOURNIER [Fri, 23 Feb 2018 14:20:55 +0000 (15:20 +0100)] 
MINOR: spoa-server: Add Lua processing

Use the defined binding for registering Lua engine.

6 years agoMINOR: spoa-server: Execute registered callbacks
Thierry FOURNIER [Fri, 23 Feb 2018 13:42:46 +0000 (14:42 +0100)] 
MINOR: spoa-server: Execute registered callbacks

Call the right function with the right engine for each received message.

6 years agoMINOR: spoa-server: Prepare responses
Thierry FOURNIER [Fri, 23 Feb 2018 17:24:10 +0000 (18:24 +0100)] 
MINOR: spoa-server: Prepare responses

This patch adds SPOP responses managament. It provides SPOP
encoding primitives. It also move the example function
ip_reputation to this new behavior.

6 years agoMINOR: spoa-server: Load files
Thierry FOURNIER [Fri, 23 Feb 2018 14:12:55 +0000 (15:12 +0100)] 
MINOR: spoa-server: Load files

Declare files to be executed at the begining and execute it. The binding
between the engine and the file is done throught the extension.

6 years agoMINOR: spoa-server: Allow registering message processors
Thierry FOURNIER [Fri, 23 Feb 2018 13:27:05 +0000 (14:27 +0100)] 
MINOR: spoa-server: Allow registering message processors

This function register processor executed by any language for processing
an SPOP message.

6 years agoMINOR: spoa-server: Allow registering external processes
Thierry FOURNIER [Fri, 23 Feb 2018 13:58:40 +0000 (14:58 +0100)] 
MINOR: spoa-server: Allow registering external processes

Add struct for declaring an reistrering external processing resource.

6 years agoMINOR: spoa-server: With debug mode, start only one process
Thierry FOURNIER [Fri, 23 Feb 2018 18:11:47 +0000 (19:11 +0100)] 
MINOR: spoa-server: With debug mode, start only one process

Because debug with processes is simpler if only one process is started.

6 years agoMINOR: spoa-server: Replace the thread init system by processes
Thierry FOURNIER [Fri, 23 Feb 2018 12:50:26 +0000 (13:50 +0100)] 
MINOR: spoa-server: Replace the thread init system by processes

I will replace thread by processes. Note that, I keep the pthread_key
system for identifiying process in the same way that threads. Note
also that I keep commented out the original thread code because I hope
to reactivate it.

6 years agoMINOR: spoe-server: rename "worker" functions
Thierry FOURNIER [Fri, 23 Feb 2018 10:59:15 +0000 (11:59 +0100)] 
MINOR: spoe-server: rename "worker" functions

"worker" name is a little bit generic and it is used in many
places, so it is hard to find the expected symbol.

6 years agoMINOR: spoa-server: Externalise debug functions
Thierry FOURNIER [Sun, 25 Feb 2018 09:54:56 +0000 (10:54 +0100)] 
MINOR: spoa-server: Externalise debug functions

Make external LOG and DEBUG function. Other process can use this ones
and later these functions will be replaced by another log system

6 years agoMINOR: spoa-server: move some definition from spoa_server.c to spoa_server.h
Thierry FOURNIER [Fri, 23 Feb 2018 10:42:57 +0000 (11:42 +0100)] 
MINOR: spoa-server: move some definition from spoa_server.c to spoa_server.h

This will allow to add some other files to the project

6 years agoMINOR: spoa-server: Clone the v1.7 spoa-example project
Thierry FOURNIER [Fri, 23 Feb 2018 10:40:03 +0000 (11:40 +0100)] 
MINOR: spoa-server: Clone the v1.7 spoa-example project

This is a working base.