The branch, v4-19-test has been updated via 6107f663046 Fix starvation of pending writes in CTDB queues via a65eda03caa build: --vendor-suffix instead of --vendor-patch-revision --vendor-name via fe5f703e428 buildtools: sanitise strange characters in vendor strings from 2cf809bb1f3 third_party/heimdal: Import lorikeet-heimdal-202406240121 (commit 4315286377278234be2f3b6d52225a17b6116d54)
https://git.samba.org/?p=samba.git;a=shortlog;h=v4-19-test - Log ----------------------------------------------------------------- commit 6107f663046a7a762d1c35beeaae0c1b46582f2e Author: Xavi Hernandez <xhernan...@redhat.com> Date: Thu Jun 27 15:41:19 2024 +0200 Fix starvation of pending writes in CTDB queues CTDB uses a queue to receive requests and send answers. It works asynchronously using the tevent framework. However there was an issue that gave priority to the receiving side so, when a request was processed and the answer posted to the queue, if another incoming request arrived, it was served before sending the previous answer. This scenario could repeat for long periods of time if the frequency of incoming requests was high enough. Eventually, a small time gap between incoming request gave a chance to process the pending output queue, sending many answers in a burst. This patch makes sure that both queues (input and output) are processed if the event contains the appropriate flag. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15678 RN: Fix unnecessary delays in CTDB while processing requests under high load. Signed-off-by: Xavi Hernandez <xhernan...@redhat.com> Reviewed-by: Volker Lendecke <v...@samba.org> Reviewed-by: Martin Schwenke <mar...@meltin.net> Autobuild-User(master): Volker Lendecke <v...@samba.org> Autobuild-Date(master): Mon Jul 1 09:17:43 UTC 2024 on atb-devel-224 (cherry picked from commit 60550fbe184a5cefa55a8f0bab508f70def7a684) Autobuild-User(v4-19-test): Jule Anger <jan...@samba.org> Autobuild-Date(v4-19-test): Tue Jul 9 08:46:54 UTC 2024 on atb-devel-224 commit a65eda03caa4e22c40893333f05f75d3208098dc Author: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> Date: Fri Jun 21 10:40:59 2024 +1200 build: --vendor-suffix instead of --vendor-patch-revision --vendor-name In practice there isn't a use for two options, and neither quite matched what people thought they were doing. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15673 Signed-off-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> Reviewed-by: Jo Sutton <josut...@catalyst.net.nz> (cherry picked from commit 673c8e6ca5994973e4887641c3599707a66a608c) commit fe5f703e4280eea502a5dbb3ca854c345b499aa6 Author: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> Date: Fri Jun 21 10:38:40 2024 +1200 buildtools: sanitise strange characters in vendor strings There is no reason to think '-' and '+' are the only characters that might sneak into a vendor string; Debian habitually use '~'. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15673 Signed-off-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> Reviewed-by: Jo Sutton <josut...@catalyst.net.nz> (cherry picked from commit 0bc5b6f29307ce758774c1b2f48ce62315fdc7f9) ----------------------------------------------------------------------- Summary of changes: buildtools/wafsamba/samba_abi.py | 6 +++--- ctdb/common/ctdb_io.c | 17 +++++++++++------ script/autobuild.py | 4 ++-- wscript | 12 +----------- 4 files changed, 17 insertions(+), 22 deletions(-) Changeset truncated at 500 lines: diff --git a/buildtools/wafsamba/samba_abi.py b/buildtools/wafsamba/samba_abi.py index 682f4e897b5..22c25b8da35 100644 --- a/buildtools/wafsamba/samba_abi.py +++ b/buildtools/wafsamba/samba_abi.py @@ -286,7 +286,7 @@ def abi_build_vscript(task): f.close() def VSCRIPT_MAP_PRIVATE(bld, libname, orig_vscript, version, private_vscript): - version = version.replace("-", "_").replace("+","_").upper() + version = re.sub(r'\W', '_', version).upper() t = bld.SAMBA_GENERATOR(private_vscript, rule=abi_build_vscript, source=orig_vscript, @@ -314,8 +314,8 @@ def ABI_VSCRIPT(bld, libname, abi_directory, version, vscript, abi_match=None, p libname = os.path.basename(libname) version = os.path.basename(version) - libname = libname.replace("-", "_").replace("+","_").upper() - version = version.replace("-", "_").replace("+","_").upper() + libname = re.sub(r'\W', '_', libname).upper() + version = re.sub(r'\W', '_', version).upper() t = bld.SAMBA_GENERATOR(vscript, rule=abi_build_vscript, diff --git a/ctdb/common/ctdb_io.c b/ctdb/common/ctdb_io.c index bf8bc73b77d..9ac9b84a7fb 100644 --- a/ctdb/common/ctdb_io.c +++ b/ctdb/common/ctdb_io.c @@ -272,7 +272,7 @@ static void queue_dead(struct tevent_context *ev, struct tevent_immediate *im, /* called when an incoming connection is writeable */ -static void queue_io_write(struct ctdb_queue *queue) +static bool queue_io_write(struct ctdb_queue *queue) { while (queue->out_queue) { struct ctdb_queue_pkt *pkt = queue->out_queue; @@ -294,14 +294,14 @@ static void queue_io_write(struct ctdb_queue *queue) queue->fd = -1; tevent_schedule_immediate(queue->im, queue->ctdb->ev, queue_dead, queue); - return; + return false; } - if (n <= 0) return; + if (n <= 0) return true; if (n != pkt->length) { pkt->length -= n; pkt->data += n; - return; + return true; } DLIST_REMOVE(queue->out_queue, pkt); @@ -310,6 +310,8 @@ static void queue_io_write(struct ctdb_queue *queue) } TEVENT_FD_NOT_WRITEABLE(queue->fde); + + return true; } /* @@ -320,10 +322,13 @@ static void queue_io_handler(struct tevent_context *ev, struct tevent_fd *fde, { struct ctdb_queue *queue = talloc_get_type(private_data, struct ctdb_queue); + if (flags & TEVENT_FD_WRITE) { + if (!queue_io_write(queue)) { + return; + } + } if (flags & TEVENT_FD_READ) { queue_io_read(queue); - } else { - queue_io_write(queue); } } diff --git a/script/autobuild.py b/script/autobuild.py index 7777c35cf12..2408bb38db6 100755 --- a/script/autobuild.py +++ b/script/autobuild.py @@ -888,10 +888,10 @@ tasks = { ("ldb-make", "cd lib/ldb && make"), ("ldb-install", "cd lib/ldb && make install"), - ("nondevel-configure", samba_libs_envvars + " ./configure --vendor-name=autobuild-TEST-STRING --vendor-patch-revision=5 ${PREFIX}"), + ("nondevel-configure", samba_libs_envvars + " ./configure --vendor-suffix=TEST-STRING~5.1.2 ${PREFIX}"), ("nondevel-make", "make -j"), ("nondevel-check", "./bin/smbd -b | grep WITH_NTVFS_FILESERVER && exit 1; exit 0"), - ("nondevel-check", "./bin/smbd --version | grep -e '-autobuild-TEST-STRING-5' && exit 0; exit 1"), + ("nondevel-check", "./bin/smbd --version | grep -F 'TEST-STRING~5.1.2' && exit 0; exit 1"), ("nondevel-no-libtalloc", "find ./bin | grep -v 'libtalloc-report' | grep 'libtalloc' && exit 1; exit 0"), ("nondevel-no-libtdb", "find ./bin | grep -v 'libtdb-wrap' | grep 'libtdb' && exit 1; exit 0"), ("nondevel-no-libtevent", "find ./bin | grep -v 'libtevent-util' | grep 'libtevent' && exit 1; exit 0"), diff --git a/wscript b/wscript index 4b183fd375c..dab97d13c24 100644 --- a/wscript +++ b/wscript @@ -140,27 +140,17 @@ def options(opt): dest='with_smb1server', help=("Build smbd with SMB1 support (default=yes).")) - opt.add_option('--vendor-name', + opt.add_option('--vendor-suffix', help=('Specify a vendor (or packager) name to include in the version string'), type="string", dest='SAMBA_VERSION_VENDOR_SUFFIX', default=None) - opt.add_option('--vendor-patch-revision', - help=('Specify a vendor (or packager) patch revision number include in the version string (requires --vendor-name)'), - type="int", - dest='SAMBA_VERSION_VENDOR_PATCH', - default=None) def configure(conf): if Options.options.SAMBA_VERSION_VENDOR_SUFFIX: conf.env.SAMBA_VERSION_VENDOR_SUFFIX = Options.options.SAMBA_VERSION_VENDOR_SUFFIX - if Options.options.SAMBA_VERSION_VENDOR_PATCH: - if not Options.options.SAMBA_VERSION_VENDOR_SUFFIX: - raise conf.fatal('--vendor-patch-revision requires --vendor-version') - conf.env.SAMBA_VERSION_VENDOR_PATCH = Options.options.SAMBA_VERSION_VENDOR_PATCH - version = samba_version.load_version(env=conf.env) conf.DEFINE('CONFIG_H_IS_FROM_SAMBA', 1) -- Samba Shared Repository