At one point, we considered supporting LuaJIT. While it turned out to be
not worth it, the prototype removal accidentally left checks in the
configure file.
Timo Sirainen [Wed, 3 Feb 2021 17:42:17 +0000 (19:42 +0200)]
fts: Fix mail_precache() and related error handling
The mail_precache() caller is now expected to stop on error, so there's
no need for fts to stop the search internally anymore. And similarly
the caller will log the mail_precache() error so the search or
transaction don't need to fail.
ft->failed is now used only for failures that are more specific to the
transaction.
Timo Sirainen [Mon, 22 Feb 2021 11:15:18 +0000 (13:15 +0200)]
lib-imap-client: Fix busy-loop if server disconnects too early when trying to logout
This can happen if:
* imapc sends NOOP to break idle
* remote server sends BYE, but doesn't immediately disconnect
* session is stopped, which causes imapc to attempt to send LOGOUT
* imapc waits for NOOP response first
* remote server disconnects
* imapc notices the disconnection, but does nothing with it, because it
thinks it's already handled. This keeps busy-looping.
* If there was a mailbox selected, this results in infinite busy-loop. If a
mailbox wasn't selected, imapc_cmd_timeout aborts the NOOP command.
Timo Sirainen [Wed, 3 Feb 2021 18:42:50 +0000 (20:42 +0200)]
lib: io_loop_context_new() no longer implicitly activates the context
The new behavior requires explicitly activating the context. This change
was needed, because an implicit creation activated the context but didn't
call any of the callbacks. If ioloop wasn't run, the activation callbacks
were never called. This meant that when context was deactivated, the
deactivation callbacks weren't run either.
Martin Michaelis [Tue, 16 Feb 2021 20:06:50 +0000 (21:06 +0100)]
stats: openmentrics: Change histogram bucket unit to seconds
In ae678116a79fff609cdf4fb1eb7eb3db2975bf1c the unit of durations was changed
from microseconds to seconds, but the `le` field in histograms is still in
microseconds.
Stephan Bosch [Fri, 4 Jan 2019 08:57:37 +0000 (09:57 +0100)]
plugins: fts-solr: Use a private HTTP client.
This is a workaround for problems with the http_client_request_send_payload()
API that occur when several shared HTTP clients use this API at the same time
and payload sending gets interleaved.
Stephan Bosch [Fri, 4 Jan 2019 08:55:20 +0000 (09:55 +0100)]
plugins: fts: tika: Use a private HTTP client.
This is a workaround for problems with the http_client_request_send_payload()
API that occur when several shared HTTP clients use this API at the same time
and payload sending gets interleaved.
lib-master: Fix haproxy PROXY protocol LOCAL type connection behavior when header includes address information or TLVs
PROXY protocol LOCAL type headers can actually include supplementary
information (addresses, TLVs) which need to be skipped to correctly handle the
header. Fixes Invalid TLV bug with haproxy 2.0.14 service checks.
More info here: https://github.com/haproxy/haproxy/issues/511
And here: https://www.mail-archive.com/haproxy@formilux.org/msg36890.html
Timo Sirainen [Tue, 16 Feb 2021 14:40:35 +0000 (16:40 +0200)]
lib: cpu-limit - Don't round current CPU usage up when checking if rlim_max is reached
The fatal error could trigger half a second too early.
Also always increase the provided cpu_limit_sec by 1 second to make sure it
won't trigger too early. Although even with this change it can still
trigger a few milliseconds too early for some reason.
Timo Sirainen [Tue, 10 Nov 2020 14:33:41 +0000 (16:33 +0200)]
lib-storage: Fix assert-crash when parsing binary attachments
EOF may not have been detected in the cur_block istream early enough,
causing the calculation to go wrong. This happened at least with empty
base64 bodies, but could have possibly happened in other situations also.
Markus Valentin [Mon, 1 Feb 2021 14:38:49 +0000 (15:38 +0100)]
acl: acl_lookup_dict_rebuild_update() - Commit transaction after each [un]set
When used with Cassandra an error can occur if multiple changes are
included into one transaction: "Multiple changes in transaction not
supported". Prevent these errors by committing every change on it's
own.
Nis Martensen [Sun, 24 May 2020 20:05:42 +0000 (22:05 +0200)]
systemd integration: notify service manager when ready
With Type=simple or Type=forking, systemd does not really know when the
service is ready to accept connections and might start depending
services too early. Use Type=notify to explicitly tell the service
manager when the service is ready.
For a real problem caused by assuming readiness too early, please see
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=951722
For the meaning of the service type and details of the readiness
protocol, see also the following links:
https://www.freedesktop.org/software/systemd/man/systemd.service.html#Type=
https://www.freedesktop.org/software/systemd/man/sd_notify.html
As discussed in the last link, more elaborate state notifications are
possible. This patch only implements the most basic part.
Original patch prepared by Michael Biebl, with slight modification.
dsync: Check namespace prefix when syncing shared namespaces
When iterating over namespaces, comparing namespace pointers doesn't
work for shared namespaces. Instead, check the prefix and include all
the mailboxes in the namespace for syncing.
If a view keeps being synced with MAIL_INDEX_VIEW_SYNC_FLAG_NOEXPUNGES,
every sync regenerated the missing log files and logged this error.
This could have resulted in lots of errors being logged about it, as
well as unnecessary CPU usage.
The view syncing was always syncing from the last "expunge log position",
even when expunges weren't being synced. The new behavior is to do that
only when expunges are synced, but otherwise use the "head log position"
to sync only the new changes since the last view sync.
The error is now logged once when the log is first noticed being lost.
Another error is logged when pending expunges are synced.
For now, we keep the read support to allow for a more gradual migration from
lzma/xz.
The code has bugs. Additionally, there is no benefit in keeping it around.
bzip2 or zstd (at maximum compression level) are likely better choices for
archival. For non-archival usecases, a light compression algorithm like
zstd (at low to medium compression level) or lz4 are better choices.