Commit Graph

2317 Commits

Author SHA1 Message Date
Willy Tarreau
32872db605 MINOR: sink/ring: rotate non-empty file-backed contents only
If the service is rechecked before a reload, that may cause the config
to be parsed twice and file-backed rings to be lost.

Here we make sure that such a ring does contain information before
deciding to rotate it. This way the first process starting after some
writes will cause a rotate but not subsequent ones until new writes
are applied.

An attempt was also made to disable rotations on checks but this was a
bad idea, as the ring is still initialized and this causes the contents
to be lost. The choice of initializing the ring during parsing is
questionable but the config check ought to be as close as possible to a
real start, and we could imagine that the ring is used by some code
during startup (e.g. lua). So this approach was abandonned and config
checks also cause a rotation, as the purpose of this rotation is to
preserve latest information against accidental removal.
2022-09-01 08:25:34 +02:00
William Lallemand
b5c2cd461d DOC: configuration.txt: do-resolve must use host_only to remove its port.
The do-resolve action does not support a port in its parameter string,
the host_only converter must be used.

Must be backported to 2.6.
2022-08-26 17:00:22 +02:00
William Lallemand
dd754cba16 MINOR: sample: add the host_only and port_only converters
Add 2 converters that can manipulate the value of an Host header.
host_only will return the host without any port, and port_only will
return the port.
2022-08-26 17:00:22 +02:00
William Lallemand
1ef2460934 DOC: configuration: do-resolve doesn't work with a port in the string
Fix the documentation about do-resolve to handle the case where a port
is associated to the hostname in the Host header.

Must be backported as far as 2.0.
2022-08-26 16:51:05 +02:00
Willy Tarreau
8bd146d8af MEDIUM: peers: limit the number of updates sent at once
As seen in GH issue #1770, peers synchronization do not cope well with
very large buffers because by default the only two reasons for stopping
the processing of updates is either that the end was reached or that
the buffer is full. This can cause high latencies, and even rightfully
trigger the watchdog when the operations are numerous and slowed down
by competition on the stick-table lock.

This patch introduces a limit to the number of messages one may send
at once, which now defaults to 200, regardless of the buffer size. This
means taking and releasing the lock up to 400 times in a row, which is
costly enough to let some other parts work.

After some observation this could be backported to 2.6. If so, however,
previous commits "BUG/MEDIUM: applet: fix incorrect check for abnormal
return condition from handler" and "BUG/MINOR: applet: make the call_rate
only count the no-progress calls" must be backported otherwise the call
rate might trigger the looping protection.
2022-08-23 20:19:11 +02:00
Willy Tarreau
f53201940b [RELEASE] Released version 2.7-dev4
Released version 2.7-dev4 with the following main changes :
    - BUG/MEDIUM: quic: Wrong packet length check in qc_do_rm_hp()
    - MINOR: quic: Too much useless traces in qc_build_frms()
    - BUG/MEDIUM: quic: Missing AEAD TAG check after removing header protection
    - MINOR: quic: Replace pool_zalloc() by pool_malloc() for fake datagrams
    - MINOR: debug: make the mem_stats section aligned to void*
    - MINOR: debug: store and report the pool's name in struct mem_stats
    - MINOR: debug: also store the function name in struct mem_stats
    - MINOR: debug/memstats: automatically determine first column size
    - MINOR: debug/memstats: permit to pass the size to free()
    - CLEANUP: mux-quic: remove loop on sending frames
    - MINOR: quic: replace custom buf on Tx by default struct buffer
    - MINOR: quic: release Tx buffer on each send
    - MINOR: quic: refactor datagram commit in Tx buffer
    - MINOR: quic: skip sending if no frame to send in io-cb
    - BUG/MINOR: mux-quic: open stream on STOP_SENDING
    - BUG/MINOR: quic: fix crash on handshake io-cb for null next enc level
    - BUG/MEDIUM: quic: always remove the connection from the accept list on close
    - BUG/MEDIUM: poller: use fd_delete() to release the poller pipes
    - BUG/MEDIUM: task: relax one thread consistency check in task_unlink_wq()
    - MEDIUM: quic: xprt traces rework
    - BUILD: stconn: fix build warning at -O3 about possible null sc
    - MINOR: quic: Remove useless lock for RX packets
    - BUG/MINOR: quic: Possible infinite loop in quic_build_post_handshake_frames()
    - CLEANUP: quic: Remove trailing spaces
    - MINOR: mux-quic: adjust enter/leave traces
    - MINOR: mux-quic: define protocol error traces
    - CLEANUP: mux-quic: adjust traces level
    - MINOR: mux-quic: define new traces
    - BUG/MEDIUM: mux-quic: fix crash due to invalid trace arg
    - BUG/MEDIUM: quic: Possible use of uninitialized <odcid> variable in qc_lstnr_params_init()
    - BUG/MEDIUM: ring: fix too lax 'size' parser
    - BUG/MEDIUM: quic: Wrong use of <token_odcid> in qc_lsntr_pkt_rcv()
    - BUILD: ring: forward-declare struct appctx to avoid a build warning
    - MINOR: ring: support creating a ring from a linear area
    - MINOR: ring: add support for a backing-file
    - DEV: haring: add a simple utility to read file-backed rings
    - DEV: haring: support remapping LF in contents with CR VT
    - BUG/MINOR: quic: memleak on wrong datagram receipt
    - BUILD: sink: replace S_IRUSR, S_IWUSR with their octal value
    - MINOR: ring: archive a previous file-backed ring on startup
    - BUG/MINOR: mux-quic: fix crash with traces in qc_detach()
    - BUG/MINOR: quic: MIssing check when building TX packets
    - BUG/MINOR: quic: Wrong status returned by qc_pkt_decrypt()
    - MINOR: memprof: export the minimum definitions for memory profiling
    - MINOR: pool/memprof: report pool alloc/free in memory profiling
    - MINOR: pools/memprof: store and report the pool's name in each bin
    - MINOR: chunk: inline alloc_trash_chunk()
    - MINOR: stick-table: Add table_expire() and table_idle() new converters
    - CLEANUP: exclude haring with .gitignore
    - MINOR: quic: adjust quic_frame flag manipulation
    - MINOR: h3: report error on control stream close
    - MINOR: qpack: report error on enc/dec stream close
    - BUG/MEDIUM: mux-quic: reject uni stream ID exceeding flow control
    - MINOR: mux-quic: adjust traces on stream init
    - MINOR: mux-quic: add missing args on some traces
    - MINOR: quic: refactor application send
    - BUG/MINOR: quic: do not notify MUX on frame retransmit
    - BUG/MEDIUM: http-ana: fix crash or wrong header deletion by http-restrict-req-hdr-names
    - BUG/MINOR: quic: Missing initializations for ducplicated frames.
    - BUG/MEDIUM: quic: fix crash on MUX send notification
    - REORG: h2: extract cookies concat function in http_htx
    - REGTESTS: add test for HTTP/2 cookies concatenation
    - MEDIUM: h3: concatenate multiple cookie headers
    - MINOR: applet: add a function to reset the svcctx of an applet
    - BUG/MEDIUM: cli: always reset the service context between commands
    - BUG/MEDIUM: mux-h2: do not fiddle with ->dsi to indicate demux is idle
    - MINOR: mux-h2/traces: report transition to SETTINGS1 before not after
    - MINOR: mux-h2: make streams know if they need to send more data
    - BUG/MINOR: mux-h2: send a CANCEL instead of ES on truncated writes
    - BUG/MINOR: quic: Possible crashes when dereferencing ->pkt quic_frame struct member
    - MINOR: quic: Add frame addresses to QUIC_EV_CONN_PRSAFRM event traces
    - BUG/MINOR: quic: Wrong splitted duplicated frames handling
    - MINOR: quic: Add the QUIC connection to mux traces
    - MINOR: quic: Trace fix in qc_release_frm()
    - BUG/MAJOR: log-forward: Fix log-forward proxies not fully initialized
    - BUG/MAJOR: log-forward: Fix ssl layer not initialized on bind even if configured
    - MINOR: quic: Add reusable cipher contexts for header protection
    - BUG/MINOR: ssl/cli: error when the ca-file is empty
    - MINOR: ssl: handle ca-file appending in cafile_entry
    - MINOR: ssl/cli: implement "add ssl ca-file"
2022-08-20 15:56:31 +02:00
William Lallemand
62c0b99e3b MINOR: ssl/cli: implement "add ssl ca-file"
In ticket #1805 an user is impacted by the limitation of size of the CLI
buffer when updating a ca-file.

This patch allows a user to append new certificates to a ca-file instead
of trying to put them all with "set ssl ca-file"

The implementation use a new function ssl_store_dup_cafile_entry() which
duplicates a cafile_entry and its X509_STORE.

ssl_store_load_ca_from_buf() was modified to take an apped parameter so
we could share the function for "set" and "add".
2022-08-19 19:58:53 +02:00
Frédéric Lécaille
bbeec37b31 MINOR: stick-table: Add table_expire() and table_idle() new converters
table_expire() returns the expiration delay for a stick-table entry associated
to an input sample. Its counterpart table_idle() returns the time the entry
remained idle since the last time it was updated.
Both converters may take a default value as second argument which is returned
when the entry is not present.
2022-08-17 10:52:15 +02:00
Willy Tarreau
ded77cc71f MINOR: ring: archive a previous file-backed ring on startup
In order to ensure that an instant restart of the process will not wipe
precious debugging information, and to leave time for an admin to archive
a copy of a ring, now upon startup, any previously existing file will be
renamed with the extra suffix ".bak", and any previously existing file
with suffix ".bak" will be removed.
2022-08-12 15:40:19 +02:00
Willy Tarreau
0b8e9ceb12 MINOR: ring: add support for a backing-file
This mmaps a file which will serve as the backing-store for the ring's
contents. The idea is to provide a way to retrieve sensitive information
(last logs, debugging traces) even after the process stops and even after
a possible crash. Right now this was possible by connecting to the CLI
and dumping the contents of the ring live, but this is not handy and
consumes quite a bit of resources before it is needed.

With a backing file, the ring is effectively RAM-mapped file, so that
contents stored there are the same as those found in the file (the OS
doesn't guarantee immediate sync but if the process dies it will be OK).

Note that doing that on a filesystem backed by a physical device is a
bad idea, as it will induce slowdowns at high loads. It's really
important that the device is RAM-based.

Also, this may have security implications: if the file is corrupted by
another process, the storage area could be corrupted, causing haproxy
to crash or to overwrite its own memory. As such this should only be
used for debugging.
2022-08-12 11:18:46 +02:00
Willy Tarreau
87e95d38a9 [RELEASE] Released version 2.7-dev3
Released version 2.7-dev3 with the following main changes :
    - BUILD: makefile: Fix install(1) handling for OpenBSD/NetBSD/Solaris/AIX
    - BUG/MEDIUM: tools: avoid calling dlsym() in static builds (try 2)
    - MINOR: resolvers: resolvers_destroy() deinit and free a resolver
    - BUG/MINOR: resolvers: shut off the warning for the default resolvers
    - BUG/MINOR: ssl: allow duplicate certificates in ca-file directories
    - BUG/MINOR: tools: fix statistical_prng_range()'s output range
    - BUG/MINOR: quic: do not send CONNECTION_CLOSE_APP in initial/handshake
    - BUILD: debug: Add braces to if statement calling only CHECK_IF()
    - BUG/MINOR: fd: Properly init the fd state in fd_insert()
    - BUG/MEDIUM: fd/threads: fix incorrect thread selection in wakeup broadcast
    - MINOR: init: load OpenSSL error strings
    - MINOR: ssl: enhance ca-file error emitting
    - BUG/MINOR: mworker/cli: relative pid prefix not validated anymore
    - BUG/MAJOR: mux_quic: fix invalid PROTOCOL_VIOLATION on POST data overlap
    - BUG/MEDIUM: mworker: proc_self incorrectly set crashes upon reload
    - BUILD: add detection for unsupported compiler models
    - BUG/MEDIUM: stconn: Only reset connect expiration when processing backend side
    - BUG/MINOR: backend: Fallback on RR algo if balance on source is impossible
    - BUG/MEDIUM: master: force the thread count earlier
    - BUG/MAJOR: poller: drop FD's tgid when masks don't match
    - DEBUG: fd: detect possibly invalid tgid in fd_insert()
    - BUG/MINOR: sockpair: wrong return value for fd_send_uxst()
    - MINOR: sockpair: move send_fd_uxst() error message in caller
    - Revert "BUG/MINOR: peers: set the proxy's name to the peers section name"
    - DEBUG: fd: split the fd check
    - MEDIUM: resolvers: continue startup if network is unavailable
    - BUG/MINOR: fd: always remove late updates when freeing fd_updt[]
    - MINOR: cli: emit a warning when _getsocks was used more than once
    - BUG/MINOR: mworker: PROC_O_LEAVING used but not updated
    - Revert "MINOR: cli: emit a warning when _getsocks was used more than once"
    - MINOR: cli: warning on _getsocks when socket were closed
    - BUG/MEDIUM: mux-quic: fix missing EOI flag to prevent streams leaks
    - MINOR: quic: Congestion control architecture refactoring
    - MEDIUM: quic: Cubic congestion control algorithm implementation
    - MINOR: quic: New "quic-cc-algo" bind keyword
    - BUG/MINOR: quic: loss time limit variable computed but not used
    - MINOR: quic: Stop looking for packet loss asap
    - BUG/MAJOR: quic: Useless resource intensive loop qc_ackrng_pkts()
    - MINOR: quic: Send packets as much as possible from qc_send_app_pkts()
    - BUG/MEDIUM: queue/threads: limit the number of entries dequeued at once
    - MAJOR: threads/plock: update the embedded library
    - MINOR: thread: provide an alternative to pthread's rwlock
    - DEBUG: tools: provide a tree dump function for ebmbtrees as well
    - MINOR: ebtree: add ebmb_lookup_shorter() to pursue lookups
    - BUG/MEDIUM: pattern: only visit equivalent nodes when skipping versions
    - BUG/MINOR: mux-quic: prevent crash if conn released during IO callback
    - CLEANUP: mux-quic: remove useless app_ops is_active callback
    - BUG/MINOR: mux-quic: do not free conn if attached streams
    - MINOR: mux-quic: save proxy instance into qcc
    - MINOR: mux-quic: use timeout server for backend conns
    - MEDIUM: mux-quic: adjust timeout refresh
    - MINOR: mux-quic: count in-progress requests
    - MEDIUM: mux-quic: implement http-keep-alive timeout
    - MINOR: peers: Add a warning about incompatible SSL config for the local peer
    - MINOR: peers: Use a dedicated reconnect timeout when stopping the local peer
    - BUG/MEDIUM: peers: limit reconnect attempts of the old process on reload
    - BUG/MINOR: peers: Use right channel flag to consider the peer as connected
    - BUG/MEDIUM: dns: Properly initialize new DNS session
    - BUG/MINOR: backend: Don't increment conn_retries counter too early
    - MINOR: server: Constify source server to copy its settings
    - REORG: server: Export srv_settings_cpy() function
    - BUG/MEDIUM: proxy: Perform a custom copy for default server settings
    - BUG/MINOR: quic: Missing in flight ack eliciting packet counter decrement
    - BUG/MEDIUM: quic: Floating point exception in cubic_root()
    - MINOR: h3: support HTTP request framing state
    - MINOR: mux-quic: refresh timeout on frame decoding
    - MINOR: mux-quic: refactor refresh timeout function
    - MEDIUM: mux-quic: implement http-request timeout
    - BUG/MINOR: quic: Avoid sending truncated datagrams
    - BUG/MINOR: ring/cli: fix a race condition between the writer and the reader
    - BUG/MEDIUM: sink: Set the sink ref for forwarders created during ring parsing
    - BUG/MINOR: sink: fix a race condition between the writer and the reader
    - BUG/MINOR: quic: do not reject datagrams matching minimum permitted size
    - MINOR: quic: Add two new stats counters for sendto() errors
    - BUG/MINOR: quic: Missing Initial packet dropping case
    - MINOR: quic: explicitely ignore sendto error
    - BUG/MINOR: quic: adjust errno handling on sendto
    - BUG/MEDIUM: quic: break out of the loop in quic_lstnr_dghdlr
    - MINOR: threads: report the number of thread groups in build options
    - MINOR: config: automatically preset MAX_THREADS based on MAX_TGROUPS
    - BUILD: SSL: allow to pass additional configure args to QUICTLS
    - CI: enable weekly "m32" builds on x86_64
    - CLEANUP: assorted typo fixes in the code and comments
    - BUG/MEDIUM: fix DH length when EC key is used
    - REGTESTS: ssl: adopt tests to OpenSSL-3.0.N
    - REGTESTS: ssl: adopt tests to OpenSSL-3.0.N
    - REGTESTS: ssl: fix grep invocation to use extended regex in ssl_generate_certificate.vtc
    - BUILD: cfgparse: always defined _GNU_SOURCE for sched.h and crypt.h
2022-08-07 17:28:59 +02:00
Ilya Shipitsin
3b64a28e15 CLEANUP: assorted typo fixes in the code and comments
This is 31st iteration of typo fixes
2022-08-06 17:12:51 +02:00
Frédéric Lécaille
43910a9450 MINOR: quic: New "quic-cc-algo" bind keyword
As it could be interesting to be able to choose the QUIC control congestion
algorithm to be used by listener, add "quic-cc-algo" new keyword to do so.
Update the documentation consequently.

Must be backported to 2.6.
2022-07-29 17:32:05 +02:00
Willy Tarreau
2200a9caef [RELEASE] Released version 2.7-dev2
Released version 2.7-dev2 with the following main changes :
    - BUG/MINOR: qpack: fix build with QPACK_DEBUG
    - MINOR: h3: handle errors on HEADERS parsing/QPACK decoding
    - BUG/MINOR: qpack: abort on dynamic index field line decoding
    - MINOR: qpack: properly handle invalid dynamic table references
    - MINOR: task: Add tasklet_wakeup_after()
    - BUG/MINOR: quic: Dropped packets not counted (with RX buffers full)
    - MINOR: quic: Add new stats counter to diagnose RX buffer overrun
    - MINOR: quic: Duplicated QUIC_RX_BUFSZ definition
    - MINOR: quic: Improvements for the datagrams receipt
    - CLEANUP: h2: Typo fix in h2_unsubcribe() traces
    - MINOR: quic: Increase the QUIC connections RX buffer size (upto 64Kb)
    - CLEANUP: mux-quic: adjust comment on qcs_consume()
    - MINOR: ncbuf: implement ncb_is_fragmented()
    - BUG/MINOR: mux-quic: do not signal FIN if gap in buffer
    - MINOR: fd: add a new FD_DISOWN flag to prevent from closing a deleted FD
    - BUG/MEDIUM: ssl/fd: unexpected fd close using async engine
    - MINOR: tinfo: make tid temporarily still reflect global ID
    - CLEANUP: config: remove unused proc_mask()
    - MINOR: debug: remove mask support from "debug dev sched"
    - MEDIUM: task: add and preset a thread ID in the task struct
    - MEDIUM: task/debug: move the ->thread_mask integrity checks to ->tid
    - MAJOR: task: use t->tid instead of ffsl(t->thread_mask) to take the thread ID
    - MAJOR: task: replace t->thread_mask with 1<<t->tid when thread mask is needed
    - CLEANUP: task: remove thread_mask from the struct task
    - MEDIUM: applet: only keep appctx_new_*() and drop appctx_new()
    - MEDIUM: task: only keep task_new_*() and drop task_new()
    - MINOR: applet: always use task_new_on() on applet creation
    - MEDIUM: task: remove TASK_SHARED_WQ and only use t->tid
    - MINOR: task: replace task_set_affinity() with task_set_thread()
    - CLEANUP: task: remove the unused task_unlink_rq()
    - CLEANUP: task: remove the now unused TASK_GLOBAL flag
    - MINOR: task: make rqueue_ticks atomic
    - MEDIUM: task: move the shared runqueue to one per thread
    - MEDIUM: task: replace the global rq_lock with a per-rq one
    - MINOR: task: remove grq_total and use rq_total instead
    - MINOR: task: replace global_tasks_mask with a check for tree's emptiness
    - MEDIUM: task: use regular eb32 trees for the run queues
    - MEDIUM: queue: revert to regular inter-task wakeups
    - MINOR: thread: make wake_thread() take care of the sleeping threads mask
    - MINOR: thread: move the flags to the shared cache line
    - MINOR: thread: only use atomic ops to touch the flags
    - MINOR: poller: centralize poll return handling
    - MEDIUM: polling: make update_fd_polling() not care about sleeping threads
    - MINOR: poller: update_fd_polling: wake a random other thread
    - MEDIUM: thread: add a new per-thread flag TH_FL_NOTIFIED to remember wakeups
    - MEDIUM: tasks/fd: replace sleeping_thread_mask with a TH_FL_SLEEPING flag
    - MINOR: tinfo: add the tgid to the thread_info struct
    - MINOR: tinfo: replace the tgid with tgid_bit in tgroup_info
    - MINOR: tinfo: add the mask of enabled threads in each group
    - MINOR: debug: use ltid_bit in ha_thread_dump()
    - MINOR: wdt: use ltid_bit in wdt_handler()
    - MINOR: clock: use ltid_bit in clock_report_idle()
    - MINOR: thread: use ltid_bit in ha_tkillall()
    - MINOR: thread: add a new all_tgroups_mask variable to know about active tgroups
    - CLEANUP: thread: remove thread_sync_release() and thread_sync_mask
    - MEDIUM: tinfo: add a dynamic thread-group context
    - MEDIUM: thread: make stopping_threads per-group and add stopping_tgroups
    - MAJOR: threads: change thread_isolate to support inter-group synchronization
    - MINOR: thread: add is_thread_harmless() to know if a thread already is harmless
    - MINOR: debug: mark oneself harmless while waiting for threads to finish
    - MINOR: wdt: do not rely on threads_to_dump anymore
    - MEDIUM: debug: make the thread dumper not rely on a thread mask anymore
    - BUILD: debug: fix build issue on clang with previous commit
    - BUILD: debug: re-export thread_dump_state
    - BUG/MEDIUM: threads: fix incorrect thread group being used on soft-stop
    - BUG/MEDIUM: thread: check stopping thread against local bit and not global one
    - MINOR: proxy: use tg->threads_enabled in hard_stop() to detect stopped threads
    - BUILD: Makefile: Add Lua 5.4 autodetect
    - CI: re-enable gcc asan builds
    - MEDIUM: mworker: set the iocb of the socketpair without using fd_insert()
    - MINOR: fd: Add BUG_ON checks on fd_insert()
    - CLEANUP: mworker: rename mworker_pipe to mworker_sockpair
    - CLEANUP: mux-quic: do not export qc_get_ncbuf
    - REORG: mux-quic: reorganize flow-control fields
    - MINOR: mux-quic: implement accessor for sedesc
    - MEDIUM: mux-quic: refactor streams opening
    - MINOR: mux-quic: rename qcs flag FIN_RECV to SIZE_KNOWN
    - MINOR: mux-quic: emit FINAL_SIZE_ERROR on invalid STREAM size
    - BUG/MINOR: peers/config: always fill the bind_conf's argument
    - BUG/MEDIUM: peers/config: properly set the thread mask
    - CLEANUP: bwlim: Set pointers to NULL when memory is released
    - BUG/MINOR: http-check: Preserve headers if not redefined by an implicit rule
    - BUG/MINOR: http-act: Properly generate 103 responses when several rules are used
    - BUG/MEDIUM: thread: mask stopping_threads with threads_enabled when checking it
    - CLEANUP: thread: also remove a thread's bit from stopping_threads on stop
    - BUG/MINOR: peers: fix possible NULL dereferences at config parsing
    - BUG/MINOR: http-htx: Fix scheme based normalization for URIs wih userinfo
    - MINOR: http: Add function to get port part of a host
    - MINOR: http: Add function to detect default port
    - BUG/MEDIUM: h1: Improve authority validation for CONNCET request
    - MINOR: http-htx: Use new HTTP functions for the scheme based normalization
    - BUG/MEDIUM: http-fetch: Don't fetch the method if there is no stream
    - REGTEESTS: filters: Fix CONNECT request in random-forwarding script
    - MEDIUM: mworker/systemd: send STATUS over sd_notify
    - BUG/MINOR: mux-h1: Be sure to commit htx changes in the demux buffer
    - BUG/MEDIUM: http-ana: Don't wait to have an empty buf to switch in TUNNEL state
    - BUG/MEDIUM: mux-h1: Handle connection error after a synchronous send
    - MEDIUM: epoll: don't synchronously delete migrated FDs
    - BUILD: debug: silence warning on gcc-5
    - BUILD: http: silence an uninitialized warning affecting gcc-5
    - BUG/MEDIUM: mux-quic: fix server chunked encoding response
    - REORG: mux-quic: rename stream initialization function
    - MINOR: mux-quic: rename stream purge function
    - MINOR: mux-quic: add traces on frame parsing functions
    - MINOR: mux-quic: implement qcs_alert()
    - MINOR: mux-quic: filter send/receive-only streams on frame parsing
    - MINOR: mux-quic: do not ack STREAM frames on unrecoverable error
    - MINOR: mux-quic: support stream opening via MAX_STREAM_DATA
    - MINOR: mux-quic: define basic stream states
    - MINOR: mux-quic: use stream states to mark as detached
    - MEDIUM: mux-quic: implement RESET_STREAM emission
    - MEDIUM: mux-quic: implement STOP_SENDING handling
    - BUG/MEDIUM: debug: fix possible hang when multiple threads dump at once
    - BUG/MINOR: quic: fix closing state on NO_ERROR code sent
    - CLEANUP: quic: clean up include on quic_frame-t.h
    - MINOR: quic: define a generic QUIC error type
    - MINOR: mux-quic: support app graceful shutdown
    - MINOR: mux-quic/h3: prepare CONNECTION_CLOSE on release
    - MEDIUM: quic: send CONNECTION_CLOSE on released MUX
    - CLEANUP: mux-quic: move qc_release()
    - MINOR: mux-quic: send one last time before release
    - MINOR: h3: store control stream in h3c
    - MINOR: h3: implement graceful shutdown with GOAWAY
    - BUG/MINOR: threads: produce correct global mask for tgroup > 1
    - BUG/MEDIUM: cli/threads: make "show threads" more robust on applets
    - BUG/MINOR: thread: use the correct thread's group in ha_tkillall()
    - BUG/MINOR: debug: enter ha_panic() only once
    - BUG/MEDIUM: debug: fix parallel thread dumps again
    - MINOR: cli/streams: show a stream's tgid next to its thread ID
    - DEBUG: cli: add a new "debug dev deadlock" expert command
    - MINOR: cli/activity: add a thread number argument to "show activity"
    - CLEANUP: applet: remove the obsolete command context from the appctx
    - MEDIUM: config: remove deprecated "bind-process" directives from frontends
    - MEDIUM: config: remove the "process" keyword on "bind" lines
    - MINOR: listener/config: make "thread" always support up to LONGBITS
    - CLEANUP: fd: get rid of the __GET_{NEXT,PREV} macros
    - MEDIUM: debug/threads: make the lock debugging take tgroups into account
    - MEDIUM: proto: stop protocols under thread isolation during soft stop
    - MEDIUM: poller: program the update in fd_update_events() for a migrated FD
    - MEDIUM: poller: disable thread-groups for poll() and select()
    - MINOR: thread: remove MAX_THREADS limitation
    - MEDIUM: cpu-map: replace the process number with the thread group number
    - MINOR: mworker/threads: limit the mworker sockets to group 1
    - MINOR: cli/threads: always bind CLI to thread group 1
    - MINOR: fd/thread: get rid of thread_mask()
    - MEDIUM: task/thread: move the task shared wait queues per thread group
    - MINOR: task: move the niced_tasks counter to the thread group context
    - DOC: design: add some thoughts about how to handle the update_list
    - MEDIUM: conn: make conn_backend_get always scan the same group
    - MAJOR: fd: remove pending updates upon real close
    - MEDIUM: fd/poller: make the update-list per-group
    - MINOR: fd: delete unused updates on close()
    - MINOR: fd: make fd_insert() apply the thread mask itself
    - MEDIUM: fd: add the tgid to the fd and pass it to fd_insert()
    - MINOR: cli/fd: show fd's tgid and refcount in "show fd"
    - MINOR: fd: add functions to manipulate the FD's tgid
    - MINOR: fd: add fd_get_running() to atomically return the running mask
    - MAJOR: fd: grab the tgid before manipulating running
    - MEDIUM: fd/poller: turn polled_mask to group-local IDs
    - MEDIUM: fd/poller: turn update_mask to group-local IDs
    - MEDIUM: fd/poller: turn running_mask to group-local IDs
    - MINOR: fd: make fd_clr_running() return the previous value instead
    - MEDIUM: fd: make thread_mask now represent group-local IDs
    - MEDIUM: fd: make fd_insert() take local thread masks
    - MEDIUM: fd: make fd_insert/fd_delete atomically update fd.tgid
    - MEDIUM: fd: quit fd_update_events() when FD is closed
    - MEDIUM: thread: change thread_resolve_group_mask() to return group-local values
    - MEDIUM: listener: switch bind_thread from global to group-local
    - MINOR: fd: add fd_reregister_all() to deal with boot-time FDs
    - MEDIUM: fd: support stopping FDs during starting
    - MAJOR: pollers: rely on fd_reregister_all() at boot time
    - MAJOR: poller: only touch/inspect the update_mask under tgid protection
    - MEDIUM: fd: support broadcasting updates for foreign groups in updt_fd_polling
    - CLEANUP: threads: remove the now unused all_threads_mask and tid_bit
    - MINOR: config: change default MAX_TGROUPS to 16
    - BUG/MEDIUM: tools: avoid calling dlsym() in static builds
2022-07-16 17:17:22 +02:00
Willy Tarreau
856d56d2d2 MINOR: config: change default MAX_TGROUPS to 16
This will allows nbtgroups > 1 to be declared in the config without
recompiling. The theoretical limit is 64, though we'd rather not push
it too far for now as some structures might be enlarged to be indexed
per group. Let's start with 16 groups max, allowing to experiment with
dual-socket machines suffering from up to 8 loosely coupled L3 caches.
It's a good start and doesn't engage us too far.
2022-07-15 21:51:48 +02:00
Willy Tarreau
d60269f93f DOC: design: add some thoughts about how to handle the update_list
This one is a real problem as it outlives the closure of the FD, and
some subtle changes are required.
2022-07-15 19:43:10 +02:00
Willy Tarreau
5b09341c02 MEDIUM: cpu-map: replace the process number with the thread group number
The principle remains the same, but instead of having a single process
and ignoring extra ones, now we set the affinity masks for the respective
threads of all groups.

The doc was updated with a few extra examples.
2022-07-15 19:43:10 +02:00
Willy Tarreau
acd644197f MEDIUM: config: remove the "process" keyword on "bind" lines
It was deprecated, marked for removal in 2.7 and was already emitting a
warning, let's get rid of it. Note that we've kept the keyword detection
to suggest to use "thread" instead.
2022-07-15 19:41:26 +02:00
Willy Tarreau
94f763b5e4 MEDIUM: config: remove deprecated "bind-process" directives from frontends
This was already causing a deprecation warning and was marked for removal
in 2.7, now it happens. An error message indicates this doesn't exist
anymore.
2022-07-15 19:41:26 +02:00
Willy Tarreau
9a7fa90239 MINOR: cli/activity: add a thread number argument to "show activity"
The output of "show activity" can be so large that the output is visually
unreadable on a screen. Let's add an option to filter on the desired
column (actually the thread number), use "0" to report only the first
column (aggregated/sum/avg), and use "-1", the default, for the normal
detailed dump.
2022-07-15 19:41:26 +02:00
Willy Tarreau
eed3911a54 MINOR: task: replace task_set_affinity() with task_set_thread()
The latter passes a thread ID instead of a mask, making the code simpler.
2022-07-01 19:15:14 +02:00
Willy Tarreau
f9de4e9fae [RELEASE] Released version 2.7-dev1
Released version 2.7-dev1 with the following main changes :
    - BUG/MINOR: ssl_ckch: Free error msg if commit changes on a cert entry fails
    - BUG/MINOR: ssl_ckch: Free error msg if commit changes on a CA/CRL entry fails
    - BUG/MEDIUM: ssl_ckch: Don't delete a cert entry if it is being modified
    - BUG/MEDIUM: ssl_ckch: Don't delete CA/CRL entry if it is being modified
    - BUG/MINOR: ssl_ckch: Don't duplicate path when replacing a cert entry
    - BUG/MINOR: ssl_ckch: Don't duplicate path when replacing a CA/CRL entry
    - BUG/MEDIUM: ssl_ckch: Rework 'commit ssl cert' to handle full buffer cases
    - BUG/MEDIUM: ssl_ckch: Rework 'commit ssl ca-file' to handle full buffer cases
    - BUG/MEDIUM: ssl/crt-list: Rework 'add ssl crt-list' to handle full buffer cases
    - BUG/MEDIUM: httpclient: Don't remove HTX header blocks before duplicating them
    - BUG/MEDIUM: httpclient: Rework CLI I/O handler to handle full buffer cases
    - MEDIUM: httpclient: Don't close CLI applet at the end of a response
    - MEDIUM: http-ana: Always report rewrite failures as PRXCOND in logs
    - CLEANUP: Re-apply xalloc_size.cocci (2)
    - REGTESTS: abortonclose: Add a barrier to not mix up log messages
    - REGTESTS: http_request_buffer: Increase client timeout to wait "slow" clients
    - CLEANUP: ssl_ckch: Use corresponding enum for commit_cacrlfile_ctx.cafile_type
    - MINOR: ssl_ckch: Simplify I/O handler to commit changes on CA/CRL entry
    - BUG/MINOR: ssl_ckch: Use right type for old entry in show_crlfile_ctx
    - BUG/MINOR: ssl_ckch: Dump CRL transaction only once if show command yield
    - BUG/MINOR: ssl_ckch: Dump CA transaction only once if show command yield
    - BUG/MINOR: ssl_ckch: Dump cert transaction only once if show command yield
    - BUG/MINOR: ssl_ckch: Init right field when parsing "commit ssl crl-file" cmd
    - CLEANUP: ssl_ckch: Remove unused field in commit_cacrlfile_ctx structure
    - MINOR: ssl_ckch: Simplify structure used to commit changes on CA/CRL entries
    - MINOR: ssl_ckch: Remove service context for "set ssl cert" command
    - MINOR: ssl_ckch: Remove service context for "set ssl ca-file" command
    - MINOR: ssl_ckch: Remove service context for "set ssl crl-file" command
    - BUG/MINOR: ssl_ckch: Fix possible uninitialized value in show_cert I/O handler
    - BUG/MINOR: ssl_ckch: Fix possible uninitialized value in show_cafile I/O handler
    - BUG/MINOR: ssl_ckch: Fix possible uninitialized value in show_crlfile I/O handler
    - BUILD: ssl_ckch: Fix build error about a possible uninitialized value
    - BUG/MINOR: ssl_ckch: Fix another possible uninitialized value
    - REGTESTS: http_abortonclose: Extend supported versions
    - REGTESTS: restrict_req_hdr_names: Extend supported versions
    - MINOR: connection: support HTTP/3.0 for smp_*_http_major fetch
    - MINOR: h3: add h3c pointer into h3s instance
    - MINOR: mux-quic: simplify decode_qcs API
    - MINOR: mux-quic/h3: adjust demuxing function return values
    - BUG/MINOR: h3: fix return value on decode_qcs on error
    - BUILD: quic: fix anonymous union for gcc-4.4
    - BUILD: compiler: implement unreachable for older compilers too
    - DEV: tcploop: reorder options in the usage message
    - DEV: tcploop: make the current address the default address
    - DEV: tcploop: make it possible to change the target address of a connect()
    - DEV: tcploop: factor out the socket creation
    - DEV: tcploop: permit port 0 to ease handling of default options
    - DEV: tcploop: add a new "bind" command to bind to ip/port.
    - DEV: tcploop: add minimal UDP support
    - BUG/MINOR: trace: Test server existence for health-checks to get proxy
    - BUG/MINOR: checks: Properly handle email alerts in trace messages
    - BUG/MEDIUM: mailers: Set the object type for check attached to an email alert
    - REGTESTS: healthcheckmail: Update the test to be functionnal again
    - REGTESTS: healthcheckmail: Relax health-check failure condition
    - BUG/MINOR: h3: fix incorrect BUG_ON assert on SETTINGS parsing
    - MEDIUM: mux-h2: try to coalesce outgoing WINDOW_UPDATE frames
    - OPTIM: mux-h2: increase h2_settings_initial_window_size default to 64k
    - BUG/MINOR: h3: fix frame type definition
    - BUG/MEDIUM: h3: fix SETTINGS parsing
    - BUG/MINOR: cli/stats: add missing trailing LF after JSON outputs
    - BUG/MINOR: server: do not enable DNS resolution on disabled proxies
    - BUG/MINOR: cli/stats: add missing trailing LF after "show info json"
    - DOC: design: update the notes on thread groups
    - BUG/MEDIUM: mux-quic: fix flow control connection Tx level
    - MINOR: mux-quic: complete BUG_ON on TX flow-control enforcing
    - BUG/MINOR: mux-quic: fix memleak on frames rejected by transport
    - BUG/MINOR: tcp-rules: Make action call final on read error and delay expiration
    - CLEANUP: check: Remove useless tests on check's stream-connector
    - BUG/MEDIUM: stconn: Don't wakeup applet for send if it won't consume data
    - BUG/MEDIUM: cli: Notify cli applet won't consume data during request processing
    - BUG/MEDIUM: mux-quic: fix segfault on flow-control frame cleanup
    - MINOR: task: move profiling bit to per-thread
    - CLEANUP: quic: use task_new_on() for single-threaded tasks
    - MINOR: tinfo: remove the global thread ID bit (tid_bit)
    - CLEANUP: hlua: check for at least 2 threads on a task
    - MINOR: thread: get rid of MAX_THREADS_MASK
    - OPTIM: task: do not consult shared WQ when we're already full
    - DOC: design: update the task vs thread affinity requirements
    - MINOR: qpack: add comments and remove a useless trace
    - MINOR: qpack: reduce dependencies on other modules
    - BUG/MINOR: qpack: support header litteral name decoding
    - MINOR: qpack: add ABORT_NOW on unimplemented decoding
    - BUG/MINOR: h3/qpack: deal with too many headers
    - MINOR: qpack: improve decoding function
    - MINOR: qpack: implement standalone decoder tool
    - BUG/BUILD: h3: fix wrong label name
    - BUG/MINOR: quic: Stop hardcoding Retry packet Version field
    - MINOR: quic: Add several nonce and key definitions for Retry tag
    - BUG/MINOR: quic: Wrong PTO calculation
    - MINOR: quic: Parse long packet version from qc_parse_hd_form()
    - CLEANUP: quid: QUIC draft-28 no more supported
    - MEDIUM: quic: Add QUIC v2 draft support
    - MINOR: quic: Released QUIC TLS extension for QUIC v2 draft
    - MEDIUM: quic: Compatible version negotiation implementation (draft-08)
    - CLEANUP: quic: Remove any reference to boringssl
    - BUG/MINOR: task: fix thread assignment in tasklet_kill()
    - BUG/MEDIUM: stream: Properly handle destructive client connection upgrades
    - MINOR: stream: Rely on stconn flags to abort stream destructive upgrade
    - CLEANUP: stconn: Don't expect to have no sedesc on detach
    - BUG/MINOR: log: Properly test connection retries to fix dontlog-normal option
    - MINOR: hlua: don't dump empty entries in hlua_traceback()
    - MINOR: hlua: add a new hlua_show_current_location() function
    - MEDIUM: debug: add a tainted flag when a shared library is loaded
    - MEDIUM: debug: detect redefinition of symbols upon dlopen()
    - BUILD: quic: Wrong HKDF label constant variable initializations
    - BUG/MINOR: quic: Unexpected half open connection counter wrapping
    - BUG/MINOR: quic_stats: Duplicate "quic_streams_data_blocked_bidi" field name
    - BUG/MINOR: quic: purge conn Rx packet list on release
    - BUG/MINOR: quic: free rejected Rx packets
    - BUG/MINOR: qpack: abort on dynamic index field line decoding
    - BUG/MEDIUM: ssl/cli: crash when crt inserted into a crt-list
    - REGTESTS: ssl: add the same cert for client/server
    - BUG/MINOR: quic: Acknowledgement must be forced during handshake
    - MINOR: quic: Dump version_information transport parameter
    - BUG/MEDIUM: mworker: use default maxconn in wait mode
    - MINOR: intops: add a function to return a valid bit position from a mask
    - TESTS: add a unit test for one_among_mask()
    - BUILD: ssl_ckch: fix "maybe-uninitialized" build error on gcc-9.4 + ARM
    - BUG/MINOR: ssl: Do not look for key in extra files if already in pem
    - BUG/MINOR: quic: Missing acknowledgments for trailing packets
    - BUG/MINOR: http-ana: Set method to HTTP_METH_OTHER when an HTTP txn is created
    - BUG/MINOR: http-fetch: Use integer value when possible in "method" sample fetch
    - MINOR: freq_ctr: Add a function to get events excess over the current period
    - BUG/MINOR: stream: only free the req/res captures when set
    - CLEANUP: pool/tree-wide: remove suffix "_pool" from certain pool names
    - MEDIUM: debug: improve DEBUG_MEM_STATS to also report pool alloc/free
    - BUG/MINOR: quic: Wrong reuse of fulfilled dgram RX buffer
    - BUG/MAJOR: quic: Big RX dgrams leak when fulfilling a buffer
    - BUG/MAJOR: quic: Big RX dgrams leak with POST requests
    - BUILD: quic+h3: 32-bit compilation errors fixes
    - MEDIUM: bwlim: Add support of bandwith limitation at the stream level
2022-06-24 22:09:05 +02:00
Christopher Faulet
2b6777021d MEDIUM: bwlim: Add support of bandwith limitation at the stream level
This patch adds a filter to limit bandwith at the stream level. Several
filters can be defined. A filter may limit incoming data (upload) or
outgoing data (download). The limit can be defined per-stream or shared via
a stick-table. For a given stream, the bandwith limitation filters can be
enabled using the "set-bandwidth-limit" action.

A bandwith limitation filter can be used indifferently for HTTP or TCP
stream. For HTTP stream, only the payload transfer is limited. The filter is
pretty simple for now. But it was designed to be extensible. The current
design tries, as far as possible, to never exceed the limit. There is no
burst.
2022-06-24 14:06:26 +02:00
Willy Tarreau
0aa6f3e64b DOC: design: update the task vs thread affinity requirements
It looks like we'll need:
  - one share timers queue for the rare tasks that need to wake up
    anywhere
  - one private timers queue per thread
  - one global queue per group
  - one local queue per thread

And may be we can simply get rid of any global/shared run queue as
we don't seem to have any task bound to a subset of threads.
2022-06-14 16:16:22 +02:00
Willy Tarreau
3ccb14d60d MINOR: thread: get rid of MAX_THREADS_MASK
This macro was used both for binding and for lookups. When binding tasks
or FDs, using all_threads_mask instead is better as it will later be per
group. For lookups, ~0UL always does the job. Thus in practice the macro
was already almost not used anymore since the rest of the code could run
fine with a constant of all ones there.
2022-06-14 11:18:40 +02:00
Willy Tarreau
680ed5f28b MINOR: task: move profiling bit to per-thread
Instead of having a global mask of all the profiled threads, let's have
one flag per thread in each thread's flags. They are never accessed more
than one at a time an are better located inside the threads' contexts for
both performance and scalability.
2022-06-14 10:38:03 +02:00
Willy Tarreau
1424774207 DOC: design: update the notes on thread groups
Some (few) elements were already done, others were clarified and worth
mentionning.
2022-06-10 16:10:04 +02:00
Glenn Strauss
0012f899dd OPTIM: mux-h2: increase h2_settings_initial_window_size default to 64k
This changes the default from RFC 7540's default 65535 (64k-1) to avoid
avoid some degenerative WINDOW_UPDATE behaviors in the wild observed with
clients using 65536 as their buffer size, and have to complete each block
with a 1-byte frame, which with some servers tend to degenerate in 1-byte
WU causing more 1-byte frames to be sent until the transfer almost only
uses 1-byte frames.

More details here: https://github.com/nghttp2/nghttp2/issues/1722

As mentioned in previous commit (MEDIUM: mux-h2: try to coalesce outgoing
WINDOW_UPDATE frames) the issue could not be reproduced with haproxy but
individual WU frames are sent so theoretically nothing prevents this from
happening. As such it should be backported as a workaround for already
deployed clients after watching for any possible side effect with rare
clients. As an added benefit, uploads from curl now use less DATA frames
(all are 16384 now). Note that the previous patch alone is sufficient to
stop the issue with curl in case this one would need to be reverted.

[wt: edited commit messaged, updated doc]
2022-06-09 09:28:21 +02:00
Willy Tarreau
29698e39ed [RELEASE] Released version 2.7-dev0
Released version 2.7-dev0 with the following main changes :
    - MINOR: version: it's development again
2022-05-31 17:05:27 +02:00
Willy Tarreau
a1efc048bf [RELEASE] Released version 2.6.0
Released version 2.6.0 with the following main changes :
    - DOC: Fix formatting in configuration.txt to fix dconv
    - CLEANUP: tcpcheck: Remove useless test on the stream-connector in tcpcheck_main
    - CLEANUP: muxes: Consider stream's sd as defined in .show_fd callback functions
    - MINOR: quic: Ignore out of packet padding.
    - CLEANUP: quic: Useless QUIC_CONN_TX_BUF_SZ definition
    - CLEANUP: quic: No more used handshake output buffer
    - MINOR: quic: QUIC transport parameters split.
    - MINOR: quic: Transport parameters dump
    - DOC: quic: Update documentation for QUIC Retry
    - MINOR: quic: Tunable "max_idle_timeout" transport parameter
    - MINOR: quic: Tunable "initial_max_streams_bidi" transport parameter
    - MINOR: quic: Clarifications about transport parameters value
    - MINOIR: quic_stats: add QUIC connection errors counters
    - BUG/MINOR: quic: Largest RX packet numbers mixing
    - MINOR: quic_stats: Add transport new counters (lost, stateless reset, drop)
    - DOC: quic: Documentation update for QUIC
    - MINOR: quic: Connection TX buffer setting renaming.
    - MINOR: h3: Add a statistics module for h3
    - MINOR: quic: Send STOP_SENDING frames if mux is released
    - MINOR: quic: Do not drop packets with RESET_STREAM frames
    - BUG/MINOR: qpack: fix buffer API usage on prefix integer encoding
    - BUG/MINOR: qpack: support bigger prefix-integer encoding
    - BUG/MINOR: h3: do not report bug on unknown method
    - SCRIPTS: add make-releases-json to recreate a releases.json file in download dirs
    - SCRIPTS: make publish-release try to launch make-releases-json
    - MINOR: htx: add an unchecked version of htx_get_head_blk()
    - BUILD: htx: use the unchecked version of htx_get_head_blk() where needed
    - BUILD: quic: use inttypes.h instead of stdint.h
    - DOC: internal: remove totally outdated diagrams
    - DOC: remove the outdated ROADMAP file
    - DOC: add maintainers for QUIC and HTTP/3
    - MINOR: h3: define h3 trace module
    - MINOR: h3: add traces on frame recv
    - MINOR: h3: add traces on frame send
    - MINOR: h3: add traces on h3s init/end
    - EXAMPLES: remove completely outdated acl-content-sw.cfg
    - BUILD: makefile: reorder objects by build time
    - DOC: fix a few spelling mistakes in the docs
    - BUG/MEDIUM: peers/cli: fix "show peers" crash
    - CLEANUP: peers/cli: stop misusing the appctx local variable
    - CLEANUP: peers/cli: make peers_dump_peer() take an appctx instead of an stconn
    - BUG/MINOR: peers: set the proxy's name to the peers section name
    - MINOR: server: indicate when no address was expected for a server
    - BUG/MINOR: peers: detect and warn on init_addr/resolvers/check/agent-check
    - DOC: peers: indicate that some server settings are not usable
    - DOC: peers: clarify when entry expiration date is renewed.
    - DOC: peers: fix port number and addresses on new peers section format
    - DOC: gpc/gpt: add commments of gpc/gpt array definitions on stick tables.
    - DOC: install: update supported OpenSSL versions in the INSTALL doc
    - MINOR: ncbuf: adjust ncb_data with NCBUF_NULL
    - BUG/MINOR: h3: fix frame demuxing
    - BUG/MEDIUM: h3: fix H3_EXCESSIVE_LOAD when receiving H3 frame header only
    - BUG/MINOR: quic: Fix QUIC_EV_CONN_PRSAFRM event traces
    - CLEANUP: quic: remove useless check on local UNI stream reception
    - BUG/MINOR: qpack: do not consider empty enc/dec stream as error
    - DOC: intro: adjust the numbering of paragrams to keep the output ordered
    - MINOR: version: mention that it's LTS now.
2022-05-31 16:58:21 +02:00
Willy Tarreau
e68e7e8426 DOC: intro: adjust the numbering of paragrams to keep the output ordered
The HTML version appeared with sections in a different order where
3.3.10..3.3.16 were placed between 3.3.1 and 3.3.2. This patch just slips
them into an intermediary section so that we now have "basic features",
"standard features", and "advanced features".
2022-05-31 16:24:43 +02:00
Emeric Brun
5e349e7b7e DOC: gpc/gpt: add commments of gpc/gpt array definitions on stick tables.
Some users misunderstood that the parameter of gpc() gpt()
store types on the table line presents the number of elements
of the array to store and not an index of gpt/gpc tag/counter.

This patch adds some explanations.

This patch addresses github issue #1630

It should be backorted in until branch 2.5.
2022-05-31 10:29:36 +02:00
Emeric Brun
e77984f700 DOC: peers: fix port number and addresses on new peers section format
This patch fix the port number and addresses on the example
to match those of the old format.

This patch address the github issue #1492

This patch should be backported until version 2.0
2022-05-31 10:29:36 +02:00
Emeric Brun
423ed389ac DOC: peers: clarify when entry expiration date is renewed.
This patch add some details to know which rules are updating
the expiration timer of an entry.

It also adds a comment to know how to fetch a value without renewing
this timer.

This patch addresses github issue #615

This patch should be backported on all still supported branches
2022-05-31 10:29:36 +02:00
Willy Tarreau
0f4a02b81a DOC: peers: indicate that some server settings are not usable
Let's make it clear in the peers documentation that not all server
parameters may be used, as there is some confusion around this, and
the doc was even misleading by saying that all parameters were
supported.

This should address github issue #919.
2022-05-31 10:23:08 +02:00
Willy Tarreau
55b9689bbe DOC: fix a few spelling mistakes in the docs
These were reported by the CI's spell checker:

   https://github.com/haproxy/haproxy/actions/runs/2411893527

A few need to be ignored ("ressources" and "trafic" being part of a URL).
2022-05-31 08:07:43 +02:00
Willy Tarreau
a80f3b5ba7 DOC: internal: remove totally outdated diagrams
The "sequence" and "entities" diagrams have become so much outdated that
they are at best confusing, but more generally wrong. Let's simply remove
them.
2022-05-30 16:56:42 +02:00
Frédéric Lécaille
38dea05ca9 MINOR: quic: Connection TX buffer setting renaming.
Rename "tune.quic.conn-buf-limit" to "tune.quic.frontend.conn-tx-buffers.limit"
to reflect the stream direction (TX) and the objects (frontends) which are
concerned.
2022-05-30 09:59:26 +02:00
Frédéric Lécaille
f717a4bc7c DOC: quic: Documentation update for QUIC
Add minimalistic information about QUIC new protocol supported by QUIC.
2022-05-30 09:59:26 +02:00
Frédéric Lécaille
2674098569 MINOR: quic: Tunable "initial_max_streams_bidi" transport parameter
Add tunable "tune.quic.frontend.max_streams_bidi" setting for QUIC frontends
to set the "initial_max_streams_bidi" transport parameter.
Add some documentation for this new setting.
2022-05-30 09:59:26 +02:00
Frédéric Lécaille
1d96d6e024 MINOR: quic: Tunable "max_idle_timeout" transport parameter
Add two tunable settings both for backends and frontends "max_idle_timeout"
QUIC transport parameter, "tune.quic.frontend.max-idle-timeout" and
"tune.quic.backend.max-idle-timeout" respectively.
cfg_parse_quic_time() has been implemented to parse a time value thanks
to parse_time_err(). It should be reused for any tunable time value to be
parsed.
Add the documentation for this tunable setting only for frontend.
2022-05-30 09:59:26 +02:00
Frédéric Lécaille
aa8daed335 DOC: quic: Update documentation for QUIC Retry
Add some information for "quic-force-retry" and "tune.quic.retry-force"
settings.
2022-05-30 09:59:26 +02:00
Tim Duesterhus
464193793e DOC: Fix formatting in configuration.txt to fix dconv
The missing space before the colon causes haproxy-dconv to misparse the
configuration.txt.
2022-05-28 05:56:20 +02:00
Willy Tarreau
0edb9977b3 [RELEASE] Released version 2.6-dev12
Released version 2.6-dev12 with the following main changes :
    - CLEANUP: tools: Clean up non-QUIC error message handling in str2sa_range()
    - BUG/MEDIUM: tools: Fix `inet_ntop` usage in sa2str
    - CLEANUP: tools: Crash if inet_ntop fails due to ENOSPC in sa2str
    - BUG/MEDIUM: mux-quic: adjust buggy proxy closing support
    - Revert "MINOR: quic: activate QUIC traces at compilation"
    - Revert "MINOR: mux-quic: activate qmux traces on stdout via macro"
    - CLEANUP: init: address a coverity warning about possible multiply overflow
    - BUG/MEDIUM: http: Properly reject non-HTTP/1.x protocols
    - MEDIUM: h1: enlarge the scope of accepted version chars with accept-invalid-http-request
    - BUG/MEDIUM: resolvers: Don't defer resolutions release in deinit function
    - BUG/MEDIUM: peers: fix segfault using multiple bind on peers sections
    - BUG/MEDIUM: peers: prevent unitialized multiple listeners on peers section
    - BUG/MINOR: task: Don't defer tasks release when HAProxy is stopping
    - MINOR: h3: mark ncbuf as const on h3_b_dup
    - MINOR: mux-quic: do not alloc quic_stream_desc for uni remote stream
    - MINOR: mux-quic: delay cs_endpoint allocation
    - MINOR: mux-quic: add traces in qc_recv()
    - MINOR: mux-quic: adjust return value of decode_qcs
    - CLEANUP: h3: rename struct h3 -> h3c
    - CLEANUP: h3: rename uni stream type constants
    - BUG/MINOR: h3: prevent overflow when parsing SETTINGS
    - MINOR: h3: refactor h3_control_send()
    - MINOR: quic: support CONNECTION_CLOSE_APP emission
    - MINOR: mux-quic: disable read on CONNECTION_CLOSE emission
    - MINOR: h3: reject too big frames
    - MINOR: mux-quic: emit STREAM_STATE_ERROR in qcc_recv
    - BUG/MINOR: mux-quic: refactor uni streams TX/send H3 SETTINGS
    - MINOR: h3/qpack: use qcs as type in decode callbacks
    - MINOR: h3: define stream type
    - MINOR: h3: refactor uni streams initialization
    - MINOR: h3: check if frame is valid for stream type
    - MINOR: h3: define non-h3 generic parsing function
    - MEDIUM: quic: refactor uni streams RX
    - CLEANUP: h3: remove h3 uni tasklet
    - MINOR: h3: abort read on unknown uni stream
    - MINOR: h3: refactor SETTINGS parsing/error reporting
    - Revert "BUG/MINOR: task: Don't defer tasks release when HAProxy is stopping"
    - DOC: configuration: add a warning for @system-ca on bind
    - CLEANUP: init: address another coverity warning about a possible multiply overflow
    - BUG/MINOR: ssl/lua: use correctly cert_ext in CertCache.set()
    - BUG/MEDIUM: sample: Fix adjusting size in word converter
    - REGTESTS: Do not use REQUIRE_VERSION for HAProxy 2.5+ (2)
    - CLEANUP: conn_stream: remove unneeded exclusion of RX_WAIT_EP from RXBLK_ANY
    - CLEANUP: conn_stream: rename the cs_endpoint's context to "conn"
    - MINOR: conn_stream: add new sets of functions to set/get endpoint flags
    - DEV: coccinelle: add cs_endp_flags.cocci
    - CLEANUP: conn_stream: apply cs_endp_flags.cocci tree-wide
    - DEV: coccinelle: add endp_flags.cocci
    - CLEANUP: conn_stream: apply endp_flags.cocci tree-wide
    - CLEANUP: conn_stream: rename the stream endpoint flags CS_EP_* to  SE_FL_*
    - CLEANUP: conn_stream: rename the cs_endpoint's target to "se"
    - CLEANUP: conn_stream: rename cs_endpoint to sedesc (stream endpoint descriptor)
    - CLEANUP: applet: rename the sedesc pointer from "endp" to "sedesc"
    - CLEANUP: conn_stream: rename the conn_stream's endp to sedesc
    - CLEANUP: conn_stream: rename cs_app_* to sc_app_*
    - CLEANUP: conn_stream: tree-wide rename to stconn (stream connector)
    - CLEANUP: mux-h1: add and use h1s_sc() to retrieve the stream connector
    - CLEANUP: mux-h2: add and use h2s_sc() to retrieve the stream connector
    - CLEANUP: mux-fcgi: add and use fcgi_strm_sc() to retrieve the stream connector
    - CLEANUP: mux-pt: add and use pt_sc() to retrieve the stream connector
    - CLEANUP: stdesc: rename the stream connector ->cs field to ->sc
    - CLEANUP: stream: rename "csf" and "csb" to "scf" and "scb"
    - CLEANUP: stconn: tree-wide rename stream connector flags CS_FL_* to SC_FL_*
    - CLEANUP: stconn: tree-wide rename stconn states CS_ST/SB_* to SC_ST/SB_*
    - MINOR: check: export wake_srv_chk()
    - MINOR: conn_stream: test the various ops functions before calling them
    - MEDIUM: stconn: merge the app_ops and the data_cb fields
    - MINOR: applet: add new wrappers to put chk/blk/str/chr to channel from appctx
    - CLEANUP: applet: use applet_put*() everywhere possible
    - CLEANUP: stconn: rename cs_{i,o}{b,c} to sc_{i,o}{b,c}
    - CLEANUP: stconn: rename cs_{check,strm,strm_task} to sc_strm_*
    - CLEANUP: stconn: rename cs_conn() to sc_conn()
    - CLEANUP: stconn: rename cs_mux() to sc_mux_strm()
    - CLEANUP: stconn: rename cs_conn_mux() to sc_mux_ops()
    - CLEANUP: stconn: rename cs_appctx() to sc_appctx()
    - CLEANUP: stconn: rename __cs_endp_target() to __sc_endp()
    - CLEANUP: stconn: rename cs_get_data_name() to sc_get_data_name()
    - CLEANUP: stconn: rename cs_conn_*() to sc_conn_*()
    - CLEANUP: stconn: rename cs_conn_get_first() to conn_get_first_sc()
    - CLEANUP: stconn: rename cs_ep_set_error() to se_fl_set_error()
    - CLEANUP: stconn: make a few functions take a const argument
    - CLEANUP: stconn: use a single function to know if SC may send to SE
    - MINOR: stconn: consider CF_SHUTW for sc_is_send_allowed()
    - MINOR: stconn: remove calls to cs_done_get()
    - MEDIUM: stconn: always rely on CF_SHUTR in addition to cs_rx_blocked()
    - MEDIUM: stconn: remove SE_FL_RXBLK_SHUT
    - MINOR: stconn: rename SE_FL_RXBLK_CONN to SE_FL_APPLET_NEED_CONN
    - MEDIUM: stconn: take SE_FL_APPLET_NEED_CONN out of the RXBLK_ANY flags
    - CLEANUP: stconn: rename cs_rx_room_{blk,rdy} to sc_{need,have}_room()
    - CLEANUP: stconn: rename cs_rx_chan_{blk,rdy} to sc_{wont,will}_read()
    - CLEANUP: stconn: rename cs_rx_buff_{blk,rdy} to sc_{need,have}_buff()
    - MINOR: stconn: start to rename cs_rx_endp_{more,done}() to se_have_{no_,}more_data()
    - MINOR: stconn: add sc_is_recv_allowed() to check for ability to receive
    - CLEANUP: stconn: rename SE_FL_RX_WAIT_EP to SE_FL_HAVE_NO_DATA
    - MEDIUM: stconn: move the RXBLK flags to the stream connector
    - CLEANUP: stconn: rename SE_FL_WANT_GET to SE_FL_WILL_CONSUME
    - CLEANUP: stconn: remove cs_tx_blocked() and cs_tx_endp_ready()
    - CLEANUP: stconn: rename cs_{want,stop}_get() to se_{will,wont}_consume()
    - CLEANUP: stconn: rename cs_cant_get() to se_need_more_data()
    - CLEANUP: stconn: rename cs_{new,create,free,destroy}_* to sc_*
    - CLEANUP: stconn: rename remaining management functions from cs_* to sc_*
    - CLEANUP: stconn: rename cs{,_get}_{src,dst} to sc_*
    - CLEANUP: stconn: rename cs_{shut,chk}* to sc_*
    - CLEANUP: stconn: rename final state manipulation functions from cs_* to sc_*
    - CLEANUP: quic: drop the name "conn_stream" from the pool variable names
    - REORG: rename cs_utils.h to sc_strm.h
    - REORG: stconn: rename conn_stream.{c,h} to stconn.{c,h}
    - CLEANUP: muxes: rename "get_first_cs" to "get_first_sc"
    - DEV: flags: use "sc" for stream conns instead of "cs"
    - CLEANUP: check: rename all occurrences of stconn "cs" to "sc"
    - CLEANUP: connection: rename all occurrences of stconn "cs" to "sc"
    - CLEANUP: stconn: rename all occurrences of stconn "cs" to "sc"
    - CLEANUP: quic/h3: rename all occurrences of stconn "cs" to "sc"
    - CLEANUP: stream: rename all occurrences of stconn "cs" to "sc"
    - CLEANUP: promex: rename all occurrences of stconn "cs" to "sc"
    - CLEANUP: stats: rename all occurrences of stconn "cs" to "sc"
    - CLEANUP: cli: rename all occurrences of stconn "cs" to "sc"
    - CLEANUP: applet: rename all occurrences of stconn "cs" to "sc"
    - CLEANUP: cache: rename all occurrences of stconn "cs" to "sc"
    - CLEANUP: dns: rename all occurrences of stconn "cs" to "sc"
    - CLEANUP: spoe: rename all occurrences of stconn "cs" to "sc"
    - CLEANUP: hlua: rename all occurrences of stconn "cs" to "sc"
    - CLEANUP: log-forward: rename all occurrences of stconn "cs" to "sc"
    - CLEANUP: http-client: rename all occurrences of stconn "cs" to "sc"
    - CLEANUP: mux-fcgi: rename all occurrences of stconn "cs" to "sc"
    - CLEANUP: mux-h1: rename all occurrences of stconn "cs" to "sc"
    - CLEANUP: mux-h2: rename all occurrences of stconn "cs" to "sc"
    - CLEANUP: mux-pt: rename all occurrences of stconn "cs" to "sc"
    - CLEANUP: peers: rename all occurrences of stconn "cs" to "sc"
    - CLEANUP: sink: rename all occurrences of stconn "cs" to "sc"
    - CLEANUP: sslsock: remove only occurrence of local variable "cs"
    - CLEANUP: applet: rename appctx_cs() to appctx_sc()
    - CLEANUP: stream: rename stream_upgrade_from_cs() to stream_upgrade_from_sc()
    - CLEANUP: obj_type: rename OBJ_TYPE_CS to OBJ_TYPE_SC
    - CLEANUP: stconn: replace a few remaining occurrences of CS in comments or traces
    - DOC: internal: update the muxes doc to mention the stconn
    - CLEANUP: mux-quic: rename the "endp" field to "sd"
    - CLEANUP: mux-h1: rename the "endp" field to "sd"
    - CLEANUP: mux-h2: rename the "endp" field to "sd"
    - CLEANUP: mux-fcgi: rename the "endp" field to "sd"
    - CLEANUP: mux-pt: rename the "endp" field to "sd"
    - CLEANUP: stconn: rename a few "endp" arguments and variables to "sd"
    - MINOR: stconn: turn SE_FL_WILL_CONSUME to SE_FL_WONT_CONSUME
    - CLEANUP: stream: remove unneeded test on appctx during initialization
    - CLEANUP: stconn: remove the new unneeded SE_FL_APP_MASK
    - DEV: flags: fix "siet" shortcut name
    - DEV: flags: rename the "endp" shortcut to "sd" for "stream descriptor"
    - DEV: flags: reorder a few SC/SE flags
    - DOC: internal: add a description of the stream connectors and descriptors
2022-05-27 19:49:31 +02:00
Willy Tarreau
de5b33e339 DOC: internal: add a description of the stream connectors and descriptors
The "layers" mini-doc shows how streams, stconn, sedesc, conns, applets
and muxes interact, with field names, pointers and invariants. It should
be completed but already provides a quick overview about what can be
guaranteed at any step and at different layers.
2022-05-27 19:34:36 +02:00
Willy Tarreau
92c2e93b0e DOC: internal: update the muxes doc to mention the stconn
The stream connector replaced the conn_stream and the sc_conn_io_cb()
function appeared. There's no place there to mention the endpoint
descriptor, but a separate diagram showing the relation between stream
and endpoint via the connector would be nice.
2022-05-27 19:33:35 +02:00
William Lallemand
1639d6c02b DOC: configuration: add a warning for @system-ca on bind
Add a warning on @system-ca on the bind line so people don't use it this
way.
2022-05-26 00:18:46 +02:00
Willy Tarreau
1ba30167a0 MEDIUM: h1: enlarge the scope of accepted version chars with accept-invalid-http-request
We used to support both RTSP and HTTP protocol version names with and
without accept-invalid-http-request, but since this is based on the
characters themselves, any protocol made of chars {0-9/.HPRST} was
possible and not others. Now that such non-standard protocols are
restricted to accept-invalid-http-request, there's no reason for not
allowing other letters. With this patch, characters {0-9./A-Z} are
permitted when the option is set.
2022-05-24 15:38:54 +02:00
Willy Tarreau
137c8fde78 [RELEASE] Released version 2.6-dev11
Released version 2.6-dev11 with the following main changes :
    - CI: determine actual LibreSSL version dynamically
    - BUG/MEDIUM: ncbuf: fix null buffer usage
    - MINOR: ncbuf: fix warnings for testing build
    - MEDIUM: http-ana: Add a proxy option to restrict chars in request header names
    - MEDIUM: ssl: Delay random generator initialization after config parsing
    - MINOR: ssl: Add 'ssl-propquery' global option
    - MINOR: ssl: Add 'ssl-provider' global option
    - CLEANUP: Add missing header to ssl_utils.c
    - CLEANUP: Add missing header to hlua_fcn.c
    - CLEANUP: Remove unused function hlua_get_top_error_string
    - BUILD: fix build warning on solaris based systems with __maybe_unused.
    - MINOR: tools: add get_exec_path implementation for solaris based systems.
    - BUG/MINOR: ssl: Fix crash when no private key is found in pem
    - CLEANUP: conn-stream: Remove cs_applet_shut declaration from header file
    - MINOR: applet: Prepare appctx to own the session on frontend side
    - MINOR: applet: Let the frontend appctx release the session
    - MINOR: applet: Change return value for .init callback function
    - MINOR: stream: Export stream_free()
    - MINOR: applet: Add appctx_init() helper fnuction
    - MINOR: applet: Add a function to finalize frontend appctx startup
    - MINOR: applet: Add function to release appctx on error during init stage
    - MEDIUM: dns: Refactor dns appctx creation
    - MEDIUM: spoe: Refactor SPOE appctx creation
    - MEDIUM: lua: Refactor cosocket appctx creation
    - MEDIUM: httpclient: Refactor http-client appctx creation
    - MINOR: sink: Add a ref to sink in the sink_forward_target structure
    - MEDIUM: sink: Refactor sink forwarder appctx creation
    - MINOR: peers: Add a ref to peers section in the peer structure
    - MEDIUM: peers: Refactor peer appctx creation
    - MINOR: applet: Add API to start applet on a thread subset
    - MEDIUM: applet: Add support for async appctx startup on a thread subset
    - MINOR: peers: Track number of applets run by thread
    - MEDIUM: peers: Balance applets across threads
    - MINOR: conn-stream/applet: Stop setting appctx as the endpoint context
    - CLEANUP: proxy: Remove dead code when parsing "http-restrict-req-hdr-names" option
    - REGTESTS: abortonclose: Fix some race conditions
    - MINOR: ssl: Add 'ssl-provider-path' global option
    - CLEANUP: http_ana: Make use of the return value of stream_generate_unique_id()
    - BUG/MINOR: spoe: Fix error handling in spoe_init_appctx()
    - CLEANUP: peers: Remove unreachable code in peer_session_create()
    - CLEANUP: httpclient: Remove useless test on ss_dst in httpclient_applet_init()
    - BUG/MEDIUM: quic: fix Rx buffering
    - OPTIM: quic: realign empty Rx buffer
    - BUG/MINOR: ncbuf: fix ncb_is_empty()
    - MINOR: ncbuf: refactor ncb_advance()
    - BUG/MINOR: mux-quic: update session's idle delay before stream creation
    - MINOR: h3: do not wait a complete frame for demuxing
    - MINOR: h3: flag demux as full on HTX full
    - MEDIUM: mux-quic: implement recv on io-cb
    - MINOR: mux-quic: remove qcc_decode_qcs() call in XPRT
    - MINOR: mux-quic: reorganize flow-control frames emission
    - MINOR: mux-quic: implement MAX_STREAM_DATA emission
    - MINOR: mux-quic: implement MAX_DATA emission
    - BUG/MINOR: mux-quic: support nul buffer with qc_free_ncbuf()
    - MINOR: mux-quic: free RX buf if empty
    - BUG/MEDIUM: config: Reset outline buffer size on realloc error in readcfgfile()
    - BUG/MINOR: check: Reinit the buffer wait list at the end of a check
    - MEDIUM: check: No longer shutdown the connection in .wake callback function
    - REORG: check: Rename and export I/O callback function
    - MEDIUM: check: Use the CS to handle subscriptions for read/write events
    - BUG/MINOR: quic: break for error on sendto
    - MINOR: quic: abort on unlisted errno on sendto()
    - MINOR: quic: detect EBADF on sendto()
    - BUG/MEDIUM: quic: fix initialization for local/remote TPs
    - CLEANUP: quic: adjust comment/coding style for TPs init
    - BUG/MINOR: cfgparse: abort earlier in case of allocation error
    - MINOR: quic: Dump initial derived secrets
    - MINOR: quic_tls: Add quic_tls_derive_retry_token_secret()
    - MINOR: quic_tls: Add quic_tls_decrypt2() implementation
    - MINOR: quic: Retry implementation
    - MINOR: cfgparse: Update for "cluster-secret" keyword for QUIC Retry
    - MINOR: quic: Move quic_lstnr_dgram_dispatch() out of xprt_quic.c
    - BUILD: stats: Missing headers inclusions from stats.h
    - MINOR: quic_stats: Add a new stats module for QUIC
    - MINOR: quic: Attach proxy QUIC stats counters to the QUIC connection
    - BUG/MINOR: quic: Fix potential memory leak during QUIC connection allocations
    - MINOR: quic: QUIC stats counters handling
    - MINOR: quic: Add tune.quic.retry-threshold keyword
    - MINOR: quic: Dynamic Retry implementation
    - MINOR: quic/mux-quic: define CONNECTION_CLOSE send API
    - MINOR: mux-quic: emit FLOW_CONTROL_ERROR
    - MINOR: mux-quic: emit STREAM_LIMIT_ERROR
    - MINOR: mux-quic: close connection on error if different data at offset
    - BUG/MINOR: peers: fix error reporting of "bind" lines
    - CLEANUP: config: improve address parser error report for unmatched protocols
    - CLEANUP: config: provide cleare hints about unsupported QUIC addresses
    - MINOR: protocol: replace ctrl_type with xprt_type and clarify it
    - MINOR: listener: provide a function to process all of a bind_conf's arguments
    - MINOR: config: use the new bind_parse_args_list() to parse a "bind" line
    - CLEANUP: listener: add a comment about what the BC_SSL_O_* flags are for
    - MINOR: listener: add a new "options" entry in bind_conf
    - CLEANUP: listener: replace all uses of bind_conf->is_ssl with BC_O_USE_SSL
    - CLEANUP: listener: replace bind_conf->generate_cers with BC_O_GENERATE_CERTS
    - CLEANUP: listener: replace bind_conf->quic_force_retry with BC_O_QUIC_FORCE_RETRY
    - CLEANUP: listener: store stream vs dgram at the bind_conf level
    - MINOR: listener: detect stream vs dgram conflict during parsing
    - MINOR: listener: set the QUIC xprt layer immediately after parsing the args
    - MINOR: listener/ssl: set the SSL xprt layer only once the whole config is known
    - MINOR: connection: add flag MX_FL_FRAMED to mark muxes relying on framed xprt
    - MINOR: config: detect and report mux and transport incompatibilities
    - MINOR: listener: automatically select a QUIC mux with a QUIC transport
    - MINOR: listener: automatically enable SSL if a QUIC transport is found
    - BUG/MINOR: quic: Fixe a typo in qc_idle_timer_task()
    - BUG/MINOR: quic: Missing <conn_opening> stats counter decrementation
    - BUILD/MINOR: cpuset fix build for FreeBSD 13.1
    - CI: determine actual OpenSSL version dynamically
2022-05-20 23:31:51 +02:00
Frédéric Lécaille
ad20a56971 MINOR: cfgparse: Update for "cluster-secret" keyword for QUIC Retry
The QUIC Retry feature is disabled if no "cluster-secret" setting was set.
2022-05-20 16:57:12 +02:00