haproxy/include/types
Willy Tarreau 082b62828d BUG/MEDIUM: init/threads: provide per-thread alloc/free function callbacks
We currently have the ability to register functions to be called early
on thread creation and at thread deinitialization. It turns out this is
not sufficient because certain such functions may use resources that are
being allocated by the other ones, thus creating a race condition depending
only on the linking order. For example the mworker needs to register a
file descriptor while the pollers will reallocate the fd_updt[] array.
Similarly logs and trashes may be used by some init functions while it's
unclear whether they have been deduplicated.

The same issue happens on deinit, if the fd_updt[] or trash is released
before some functions finish to use them, we'll get into trouble.

This patch creates a couple of early and late callbacks for per-thread
allocation/freeing of resources. A few init functions were moved there,
and the fd init code was split between the two (since it used to both
allocate and initialize at once). This way the init/deinit sequence is
expected to be safe now.

This patch should be backported to 1.9 as at least the trash/log issue
seems to be present. The run_thread_poll_loop() code is a bit different
there as the mworker is not a callback, but it will have no effect and
it's enough to drop the mworker changes.

This bug was reported by Ilya Shipitsin in github issue .
2019-05-22 14:59:08 +02:00
..
acl.h REORG/MAJOR: session: rename the "session" entity to "stream" 2015-04-06 11:23:56 +02:00
action.h MEDIUM: regex: modify regex_comp() to atomically allocate/free the my_regex struct 2019-05-07 06:58:15 +02:00
activity.h MINOR: activity: report context switch counts instead of rates 2019-04-30 14:55:18 +02:00
applet.h MEDIUM: stick-table: Stop handling stick-tables as proxies. 2019-05-07 06:54:06 +02:00
arg.h MEDIUM: stick-table: Stop handling stick-tables as proxies. 2019-05-07 06:54:06 +02:00
auth.h MAJOR: auth: Change the internal authentication system. 2014-03-17 18:06:06 +01:00
backend.h MEDIUM: backend: move all LB algo parameters into an union 2019-01-14 19:33:17 +01:00
capture.h CLEANUP: pools: rename all pool functions and pointers to remove this "2" 2017-11-24 17:49:53 +01:00
channel.h MINOR: channel: Report EOI on the input channel if it was reached in the mux 2019-03-25 06:24:43 +01:00
checks.h MINOR: checks: Store the proxy in checks. 2019-01-14 11:15:11 +01:00
cli.h MEDIUM: cli: disable some keywords in the master 2018-10-28 13:51:39 +01:00
compression.h MAJOR: buffer: finalize buffer detachment 2018-07-19 16:23:43 +02:00
connection.h CLEANUP: connection: remove the handle field from the wait_event struct 2019-05-13 19:14:52 +02:00
counters.h MINOR: cache: report the number of cache lookups and cache hits 2018-12-14 14:00:25 +01:00
dns.h MINOR: dns: dns_requester structures are now in a memory pool 2019-04-23 11:33:48 +02:00
fd.h CLEANUP: Fix typos in the file descriptor subsystem 2018-12-02 18:43:25 +01:00
filters.h MEDIUM: streams: Add the ability to retry a request on L7 failure. 2019-05-04 10:19:56 +02:00
freq_ctr.h
global.h BUG/MEDIUM: init/threads: provide per-thread alloc/free function callbacks 2019-05-22 14:59:08 +02:00
hdr_idx.h
hlua.h MEDIUM: regex: modify regex_comp() to atomically allocate/free the my_regex struct 2019-05-07 06:58:15 +02:00
http_htx.h REORG: htx: merge types+proto into common/htx.h 2018-12-11 17:15:04 +01:00
lb_chash.h MINOR: backend: move hash_balance_factor out of chash 2019-01-14 19:33:17 +01:00
lb_fas.h
lb_fwlc.h
lb_fwrr.h
lb_map.h MEDIUM: threads/lb: Make LB algorithms (lb_*.c) thread-safe 2017-10-31 13:58:31 +01:00
listener.h CLEANUP: ssl: never include openssl/*.h outside of openssl-compat.h anymore 2019-05-10 09:36:42 +02:00
log.h MINOR: log: Enable the log sampling and load-balancing feature. 2019-04-30 09:25:09 +02:00
mailers.h MINOR: mailers: make it possible to configure the connection timeout 2016-02-20 15:33:06 +01:00
map.h CLEANUP: map: it seems that the map were planed to be chained 2016-03-30 15:41:15 +02:00
obj_type.h MINOR: obj_type: new object type for struct stream 2019-04-23 11:35:56 +02:00
pattern.h MINOR: threads: Use __decl_hathreads to declare locks 2017-11-13 11:38:17 +01:00
peers.h MINOR: peers: Add a message for heartbeat. 2019-03-01 09:33:26 +01:00
pipe.h
port_range.h BUG/MEDIUM: port_range: Make the ring buffer lock-free. 2019-04-30 15:10:17 +02:00
proto_http.h MINOR: stats: Move stuff about the stats status codes in stats files 2019-03-15 14:34:59 +01:00
proto_udp.h MEDIUM: protocol: add minimalist UDP protocol client 2015-06-13 22:07:35 +02:00
protocol_buffers.h MINOR: sample: Rework gRPC converter code. 2019-03-05 11:04:23 +01:00
protocol.h MEDIUM: tcp: add the "tfo" option to support TCP fastopen on the server 2019-05-06 22:29:39 +02:00
proxy.h MINOR: stick-tables: Add peers process binding computing. 2019-05-07 06:54:07 +02:00
queue.h MINOR: queue: replace the linked list with a tree 2018-08-10 15:06:27 +02:00
sample.h REORG: http: move the HTTP semantics definitions to http.h/http.c 2018-09-11 10:30:25 +02:00
server.h CLEANUP: ssl: make inclusion of openssl headers safe 2019-05-10 09:58:43 +02:00
session.h MEDIUM: sessions: Keep track of which connections are idle. 2018-12-28 19:16:03 +01:00
shctx.h MINOR: shctx: Change max. object size type to unsigned int. 2018-10-26 04:54:40 +02:00
signal.h
spoe.h BUG/MEDIUM: spoe: arg len encoded in previous frag frame but len changed 2019-04-29 16:02:05 +02:00
ssl_sock.h CLEANUP: ssl: make inclusion of openssl headers safe 2019-05-10 09:58:43 +02:00
stats.h MINOR: action: new '(http-request|tcp-request content) do-resolve' action 2019-04-23 11:41:52 +02:00
stick_table.h MINOR: stick-table: Add prefixes to stick-table names. 2019-05-07 06:54:07 +02:00
stream_interface.h MEDIUM: streams: Add a new http action, disable-l7-retry. 2019-05-10 17:49:09 +02:00
stream.h MINOR: stream: measure and report a stream's call rate in "show sess" 2019-04-24 16:04:23 +02:00
task.h CLEANUP: task: move the task_per_thread definition to task.h 2019-04-30 14:36:47 +02:00
template.h
vars.h MINOR: threads: Use __decl_hathreads to declare locks 2017-11-13 11:38:17 +01:00