]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
6 years agolib-dns: Remove useless code
Aki Tuomi [Fri, 24 Aug 2018 08:42:56 +0000 (11:42 +0300)] 
lib-dns: Remove useless code

Found by scan-build

6 years agolib-http: Hook lib-http event to connection event
Aki Tuomi [Fri, 17 Aug 2018 11:27:52 +0000 (14:27 +0300)] 
lib-http: Hook lib-http event to connection event

6 years agodns, lib-dns: Move to protocol v1.0
Aki Tuomi [Fri, 17 Aug 2018 08:33:18 +0000 (11:33 +0300)] 
dns, lib-dns: Move to protocol v1.0

6 years agodns: Add event support
Aki Tuomi [Tue, 31 Jul 2018 09:51:54 +0000 (12:51 +0300)] 
dns: Add event support

6 years agodns: Use connection.c
Aki Tuomi [Thu, 16 Aug 2018 07:32:38 +0000 (10:32 +0300)] 
dns: Use connection.c

This enables processing multiple requests at a time.

6 years agolib: connection - Add and fix logging
Aki Tuomi [Thu, 2 Aug 2018 14:22:51 +0000 (17:22 +0300)] 
lib: connection - Add and fix logging

6 years agolib: connection - Add event support
Aki Tuomi [Thu, 2 Aug 2018 14:22:37 +0000 (17:22 +0300)] 
lib: connection - Add event support

6 years agolib-dns: Add event support
Aki Tuomi [Tue, 31 Jul 2018 09:52:19 +0000 (12:52 +0300)] 
lib-dns: Add event support

6 years agolib-dns: Move calling callback to separate function
Aki Tuomi [Tue, 31 Jul 2018 09:45:17 +0000 (12:45 +0300)] 
lib-dns: Move calling callback to separate function

Simplifies next commit

6 years agolib-dns: Initialize lookup earlier
Aki Tuomi [Fri, 17 Aug 2018 11:36:13 +0000 (14:36 +0300)] 
lib-dns: Initialize lookup earlier

6 years agolib-dns: Compose final command in dns_client_lookup_common
Aki Tuomi [Fri, 17 Aug 2018 07:55:39 +0000 (10:55 +0300)] 
lib-dns: Compose final command in dns_client_lookup_common

Makes logging easier

6 years agolib-dns: Use connection with dns-client
Aki Tuomi [Thu, 16 Aug 2018 12:24:30 +0000 (15:24 +0300)] 
lib-dns: Use connection with dns-client

6 years agolib: lib-event - Add inc_int to passthrough events
Aki Tuomi [Fri, 17 Aug 2018 07:39:05 +0000 (10:39 +0300)] 
lib: lib-event - Add inc_int to passthrough events

Was forgotten in 12927b843387b2a93fcf1d2e05df7c79af06e567

6 years agolib: Make io_loop_move_*(NULL) no-op
Aki Tuomi [Thu, 23 Aug 2018 11:58:44 +0000 (14:58 +0300)] 
lib: Make io_loop_move_*(NULL) no-op

6 years agolib: Use i_asserts() for NULL-checks in test_event_filter_inc_int()
Martti Rannanjärvi [Tue, 28 Aug 2018 09:00:54 +0000 (12:00 +0300)] 
lib: Use i_asserts() for NULL-checks in test_event_filter_inc_int()

This is so scan-build doesn't explore the assertations not holding and
create noise with that.

6 years agolib: Add test for event_inc_int()
Martti Rannanjärvi [Mon, 27 Aug 2018 11:36:33 +0000 (14:36 +0300)] 
lib: Add test for event_inc_int()

6 years agolib: test-event-filter - Test overriding parent fields
Timo Sirainen [Thu, 16 Aug 2018 09:27:06 +0000 (12:27 +0300)] 
lib: test-event-filter - Test overriding parent fields

6 years agolib: Add event_field_clear() to allow clearing parent event's fields
Timo Sirainen [Thu, 16 Aug 2018 09:17:38 +0000 (12:17 +0300)] 
lib: Add event_field_clear() to allow clearing parent event's fields

6 years agolib: Add event_inc_int()
Timo Sirainen [Wed, 15 Aug 2018 13:33:49 +0000 (16:33 +0300)] 
lib: Add event_inc_int()

This can be useful when updating counter fields.

6 years agolib: Add test for stats_dist_get_variance()
Martti Rannanjärvi [Tue, 31 Jul 2018 05:23:49 +0000 (08:23 +0300)] 
lib: Add test for stats_dist_get_variance()

6 years agolib,stats,dict: Make stats_dist_get_avg() return double
Martti Rannanjärvi [Mon, 20 Aug 2018 10:56:40 +0000 (13:56 +0300)] 
lib,stats,dict: Make stats_dist_get_avg() return double

6 years agoman, doveadm: Rename "mailbox cache compress" to "mailbox cache purge"
Timo Sirainen [Tue, 11 Sep 2018 07:10:13 +0000 (10:10 +0300)] 
man, doveadm: Rename "mailbox cache compress" to "mailbox cache purge"

The "compress" word makes it sound like e.g. zlib compression. The "purge"
word is used for a similar behavior with mdbox purging.

6 years agodoveadm: Add mailbox cache compress
Timo Sirainen [Sun, 29 Apr 2018 10:45:05 +0000 (13:45 +0300)] 
doveadm: Add mailbox cache compress

6 years agolib-index: Add mail_cache_compress_forced()
Timo Sirainen [Sun, 29 Apr 2018 10:44:59 +0000 (13:44 +0300)] 
lib-index: Add mail_cache_compress_forced()

6 years agodoveadm-auth-server: Fix cmd_list output to use JSON
Aki Tuomi [Wed, 19 Sep 2018 09:34:57 +0000 (12:34 +0300)] 
doveadm-auth-server: Fix cmd_list output to use JSON

Fixes output for HTTP client

6 years agodoveadm-auth-server: Do not use i_fatal on user listing error
Aki Tuomi [Wed, 19 Sep 2018 09:27:50 +0000 (12:27 +0300)] 
doveadm-auth-server: Do not use i_fatal on user listing error

Breaks error reporting to HTTP client

6 years agodict-client: Avoid excessive CPU usage while waiting commands to finish
Timo Sirainen [Fri, 14 Sep 2018 10:19:16 +0000 (13:19 +0300)] 
dict-client: Avoid excessive CPU usage while waiting commands to finish

client_dict_add_timeout() adds the timeout thinking that the dict no longer
has any work to do, so it can be freed soon. However, if other work is
added before that, the timeout just keeps getting called over and over
again. This is especially bad with the default idle timeout of 0.

6 years agologin-proxy: Fix logging reason when kicking non-logged in connections
Timo Sirainen [Fri, 6 Jul 2018 10:12:51 +0000 (13:12 +0300)] 
login-proxy: Fix logging reason when kicking non-logged in connections

Use the same reason as for logged in connections.

6 years agoimap: Fix command ambiguity checking with special plugins
Timo Sirainen [Mon, 6 Aug 2018 09:39:25 +0000 (12:39 +0300)] 
imap: Fix command ambiguity checking with special plugins

If the tagged line is already sent, that command can't result in ambiguity
anymore.

A cleaner fix would be to add a new _WAIT_SYNC_OUTPUT state, but that
requires all the existing code to understand that new state correctly, so it
has a higher chance of breaking something. So at least for now don't add it.

6 years agolib-http: test-http-client-errors: Address another reliability issue in "peer reuse...
Stephan Bosch [Thu, 13 Sep 2018 07:16:41 +0000 (09:16 +0200)] 
lib-http: test-http-client-errors: Address another reliability issue in "peer reuse failure" test.

6 years agolib-http: response: Add convenience functions for status evaluation.
Stephan Bosch [Thu, 13 Sep 2018 18:44:22 +0000 (20:44 +0200)] 
lib-http: response: Add convenience functions for status evaluation.

6 years agolib-http: test-http-client-errors: Make "peer reuse failure" test reliable.
Stephan Bosch [Mon, 13 Aug 2018 17:23:31 +0000 (19:23 +0200)] 
lib-http: test-http-client-errors: Make "peer reuse failure" test reliable.

It was highly timing-sensitive, since it required a particular error status to
be returned. Sometimes, it would yield a different error based on a
slightly different order of events, making the test fail. Such failures aren't
relevant though, since this regression test is about triggering a segfault that
used to occur.

6 years agoauth: mycrypt - include crypt.h
Aki Tuomi [Wed, 8 Aug 2018 09:33:20 +0000 (12:33 +0300)] 
auth: mycrypt - include crypt.h

Fixes crypt usage on glibc-2.28

Reported by Reuben Farrelly
Patch provided by Thore Bödecker

6 years agolib-master: ipc-client: Don't free command too early
Timo Sirainen [Tue, 2 Oct 2018 07:22:11 +0000 (10:22 +0300)] 
lib-master: ipc-client: Don't free command too early

When multiple replies were received by IPC only the final reply should free
the command. This may have caused e.g. "doveadm proxy list" to crash.
Broken by 435f0545b200767c25a5daee17cd6b4998d03710

6 years agodirector: Allow fully freeing user while waiting for IPC kick to finish
Timo Sirainen [Thu, 5 Jul 2018 11:55:38 +0000 (14:55 +0300)] 
director: Allow fully freeing user while waiting for IPC kick to finish

director_user_move_free() will now just free the IPC command, so this isn't
a problem anymore.

6 years agodirector: Fix crash when user kill times out before IPC finishes
Timo Sirainen [Thu, 5 Jul 2018 11:53:02 +0000 (14:53 +0300)] 
director: Fix crash when user kill times out before IPC finishes

Abort the IPC kick command when freeing kill context so the IPC callback
won't be called.

6 years agolib-master: ipc-client: Support aborting commands
Timo Sirainen [Thu, 5 Jul 2018 11:42:30 +0000 (14:42 +0300)] 
lib-master: ipc-client: Support aborting commands

6 years agolib-master: ipc-client: Cleanup - avoid extra return in the function
Timo Sirainen [Thu, 5 Jul 2018 11:41:38 +0000 (14:41 +0300)] 
lib-master: ipc-client: Cleanup - avoid extra return in the function

Simplifies the following commit.

6 years agolib-master: ipc-client: Never call callback directly from ipc_client_cmd()
Timo Sirainen [Thu, 5 Jul 2018 11:38:51 +0000 (14:38 +0300)] 
lib-master: ipc-client: Never call callback directly from ipc_client_cmd()

This may simplify the calling code, especially after the following commit
that returns the command pointer.

6 years agolib-master: ipc-client: Split code to ipc_client_abort_commands()
Timo Sirainen [Thu, 5 Jul 2018 11:35:51 +0000 (14:35 +0300)] 
lib-master: ipc-client: Split code to ipc_client_abort_commands()

6 years agolib-master: ipc-client: Use linked list of commads instead of array
Timo Sirainen [Thu, 5 Jul 2018 11:25:46 +0000 (14:25 +0300)] 
lib-master: ipc-client: Use linked list of commads instead of array

Needed for the following commit that returns the command pointer.

6 years agolib-master: ipc-client: Don't call callback twice if IPC proxy sends invalid input
Timo Sirainen [Thu, 5 Jul 2018 10:40:43 +0000 (13:40 +0300)] 
lib-master: ipc-client: Don't call callback twice if IPC proxy sends invalid input

ipc_client_disconnect() called it once, and the second time was done with
the cmds[0] that was already removed from the array.

6 years agopop3: Do not expunge \Deleted mails without QUIT
Aki Tuomi [Wed, 5 Sep 2018 16:34:20 +0000 (19:34 +0300)] 
pop3: Do not expunge \Deleted mails without QUIT

Prevents loss of email if connection
is unexpectedly terminated.

6 years agocassandra: Add proper log levels to logged messages
Timo Sirainen [Thu, 26 Apr 2018 18:07:31 +0000 (21:07 +0300)] 
cassandra: Add proper log levels to logged messages

If logging to "internal handler", i.e. to log process, write the log prefix
that includes the log level. This way Cassandra's trace/debug/info messages
won't end up in error log.

6 years agolib: Add i_failure_handler_is_internal()
Timo Sirainen [Thu, 26 Apr 2018 18:07:22 +0000 (21:07 +0300)] 
lib: Add i_failure_handler_is_internal()

7 years agolib-storage: fail storage: Allocate event for mailbox.
Stephan Bosch [Wed, 20 Jun 2018 10:40:37 +0000 (12:40 +0200)] 
lib-storage: fail storage: Allocate event for mailbox.

Absence of event causes segfault when event logging is performed for the
mailbox.

7 years agolib-master: Unit test for sending events to stats.
Sergey Kitov [Mon, 1 Oct 2018 08:02:58 +0000 (11:02 +0300)] 
lib-master: Unit test for sending events to stats.

7 years agolib-smtp: client: Make the initialization of the connection after SSL handshake reliable.
Stephan Bosch [Wed, 26 Sep 2018 10:25:59 +0000 (12:25 +0200)] 
lib-smtp: client: Make the initialization of the connection after SSL handshake reliable.

Before, the connection was not guaranteed to be fully initialized after the SSL
handshake. The problem would occur when the handshake finished while writing the
SSL output stream. In a similar HTTP client issue, this caused a segfault.

7 years agolib-http: client: Fix segfault by making the initialization of the connection after...
Stephan Bosch [Tue, 25 Sep 2018 22:26:32 +0000 (00:26 +0200)] 
lib-http: client: Fix segfault by making the initialization of the connection after SSL handshake reliable.

Before, the connection was not guaranteed to be fully initialized after the SSL
handshake. The problem would occur when the handshake finished while writing the
SSL output stream.

7 years agosubmission: Reorder initialization code
Aki Tuomi [Thu, 23 Aug 2018 17:29:58 +0000 (20:29 +0300)] 
submission: Reorder initialization code

login_set socket paths get invalidated when
master_service_init_finish is called, so we need
to run the code that uses them before this.

7 years agolib-smtp: Increase memory pool initial sizes
Aki Tuomi [Thu, 23 Aug 2018 16:15:50 +0000 (19:15 +0300)] 
lib-smtp: Increase memory pool initial sizes

This reduces malloc traffic

7 years agolib-smtp: server: Fix memory leak occurring when an error occurs early for BDAT/BURL.
Stephan Bosch [Tue, 19 Jun 2018 22:22:47 +0000 (00:22 +0200)] 
lib-smtp: server: Fix memory leak occurring when an error occurs early for BDAT/BURL.

7 years agolib-smtp: server: connection: Rely on i_stream_destroy(NULL) being a no-op.
Stephan Bosch [Wed, 20 Jun 2018 13:54:21 +0000 (15:54 +0200)] 
lib-smtp: server: connection: Rely on i_stream_destroy(NULL) being a no-op.

7 years agolib-smtp: server: Restructure reference counting of BDAT/BURL chain stream.
Stephan Bosch [Tue, 19 Jun 2018 22:31:43 +0000 (00:31 +0200)] 
lib-smtp: server: Restructure reference counting of BDAT/BURL chain stream.

It is now dereferenced directly, rather than via a local variable; thereby
making sure it is reset to NULL.

7 years agodirector: Fix assert-crash when doveadm disconnects immediately after sending command
Timo Sirainen [Fri, 29 Jun 2018 11:37:36 +0000 (14:37 +0300)] 
director: Fix assert-crash when doveadm disconnects immediately after sending command

Any command that requires a ring sync should cause the doveadm connection to
wait until the ring is synced. However, if the disconnection happened early
enough the connection is deinitialized before the ring sync is finished.

Fixes:
Panic: file doveadm-connection.c: line 1097 (doveadm_connection_deinit): assertion failed: (conn->to_ring_sync_abort == NULL)

7 years agodirector: Add assert to make sure doveadm connection's IO isn't added multiple times
Timo Sirainen [Wed, 19 Sep 2018 08:32:08 +0000 (11:32 +0300)] 
director: Add assert to make sure doveadm connection's IO isn't added multiple times

7 years agodoveadm: Make sure to stop running commands requiring synced ring when ring is no...
Timo Sirainen [Fri, 7 Sep 2018 17:04:48 +0000 (20:04 +0300)] 
doveadm: Make sure to stop running commands requiring synced ring when ring is no longer synced

A command could desync the ring, and no more commands should be run
afterwards.

This also fixes a bug where a command that desyncs the ring is supposed to
wait for the ring being synced before returning OK, but returns it
immediately instead.

7 years agolib/printf-format-fix: fix rejection of "%.0f" as a valid string
Phil Carmody [Wed, 3 Jan 2018 13:54:15 +0000 (15:54 +0200)] 
lib/printf-format-fix: fix rejection of "%.0f" as a valid string

Sometimes you want to calculate in floats, but don't want the decimals
printed.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
7 years agolib-smtp: reply-parser: Fix closing the text_lines array with NULL sentinel.
Stephan Bosch [Wed, 19 Sep 2018 20:26:08 +0000 (22:26 +0200)] 
lib-smtp: reply-parser: Fix closing the text_lines array with NULL sentinel.

For (EHLO) replies with more than 7 lines, the text_lines array of the reply did
not end in NULL, causing a segfault.

7 years agolib: i_zero*() - Give compiler error if it's wrongly used on an array
Timo Sirainen [Thu, 13 Sep 2018 12:30:22 +0000 (15:30 +0300)] 
lib: i_zero*() - Give compiler error if it's wrongly used on an array

7 years agolib-master, auth: Fix clearing memory
Timo Sirainen [Thu, 13 Sep 2018 12:29:45 +0000 (15:29 +0300)] 
lib-master, auth: Fix clearing memory

It doesn't look like these being wrong were causing any bugs.

7 years agodoveadm stats dump: Fix potentially not writing all stats output
Timo Sirainen [Tue, 11 Sep 2018 12:54:39 +0000 (15:54 +0300)] 
doveadm stats dump: Fix potentially not writing all stats output

It depended on whether uninitialized stack memory was 0 or not.

7 years agolib: Mark signal waiting IO as "never wait alone"
Timo Sirainen [Fri, 17 Aug 2018 08:34:02 +0000 (11:34 +0300)] 
lib: Mark signal waiting IO as "never wait alone"

This signal is being automatically moved to nested ioloops. It can't be the
only IO being waited, since there's no code that simply wants to wait for a
signal.

7 years agolib: ioloop-epoll/kqueue: Remove now unnecessary infinite wait check.
Timo Sirainen [Fri, 17 Aug 2018 08:33:17 +0000 (11:33 +0300)] 
lib: ioloop-epoll/kqueue: Remove now unnecessary infinite wait check.

The previous change adds this globally to io_loop_run_get_wait_time().

7 years agolib: Add io_set_never_wait_alone()
Timo Sirainen [Fri, 17 Aug 2018 08:32:10 +0000 (11:32 +0300)] 
lib: Add io_set_never_wait_alone()

If ioloop is run without any timeouts and without IOs that don't have this
flag, assert-crash rather than going to infinite wait.

7 years agolib: Add and use io_loop_run_get_wait_time()
Timo Sirainen [Fri, 17 Aug 2018 08:29:30 +0000 (11:29 +0300)] 
lib: Add and use io_loop_run_get_wait_time()

This is going to be called just before running an ioloop iteration.
The next commit improves its behavior.

7 years agolib-storage: Don't try to deserialize bodystructure if we already have it
Josef 'Jeff' Sipek [Fri, 7 Sep 2018 14:43:43 +0000 (10:43 -0400)] 
lib-storage: Don't try to deserialize bodystructure if we already have it

Fixes:
Panic: file message-part-data.c: line 37 (message_part_data_is_plain_7bit): assertion failed: (data != NULL)

7 years agolib-storage: Simplify an assertion condition
Josef 'Jeff' Sipek [Thu, 6 Sep 2018 15:07:22 +0000 (11:07 -0400)] 
lib-storage: Simplify an assertion condition

Since the i_assert() is guarded by a check for save_bodystructure_header
being true, the whole condition can be simplified.

7 years agolib-storage: Don't try to process header if we haven't parsed the body structure
Josef 'Jeff' Sipek [Thu, 6 Sep 2018 15:06:17 +0000 (11:06 -0400)] 
lib-storage: Don't try to process header if we haven't parsed the body structure

Fixes:
Panic: file index-mail-headers.c: line 294 (index_mail_parse_header): assertion failed: (part != NULL)

7 years agolib: Move log type to be written before appended log prefix
Timo Sirainen [Fri, 31 Aug 2018 12:06:09 +0000 (15:06 +0300)] 
lib: Move log type to be written before appended log prefix

This changes the logging format back to how it used to be before the event
logging changes.

7 years agolib: Add failure_context.log_prefix_type_pos
Timo Sirainen [Fri, 31 Aug 2018 12:03:37 +0000 (15:03 +0300)] 
lib: Add failure_context.log_prefix_type_pos

If non-zero, this specifies where the log type (e.g. "Info: ") is written
within the log prefix. By default it's appended.

7 years agolib, log: Add log prefix length to internal logging protocol
Timo Sirainen [Fri, 31 Aug 2018 12:01:38 +0000 (15:01 +0300)] 
lib, log: Add log prefix length to internal logging protocol

This way log process knows which part of the text is the log prefix, and
which part is the logged text.

7 years agolog: Move data stack frame allocation to parent function
Timo Sirainen [Fri, 31 Aug 2018 11:57:13 +0000 (14:57 +0300)] 
log: Move data stack frame allocation to parent function

This simplifies the next commit, which requires data stack nearly always
when logging. The data stack frames are cheap enough that we don't really
need to optimize for avoiding the cases when they're not needed.

7 years agolog: Avoid unnecessary global log prefix changes
Timo Sirainen [Fri, 31 Aug 2018 11:54:18 +0000 (14:54 +0300)] 
log: Avoid unnecessary global log prefix changes

If the context specifies a log prefix, the global prefix isn't going to be
used.

7 years agolib: failures - Use common log_prefix_add() for default and syslog formatters
Timo Sirainen [Fri, 31 Aug 2018 11:50:52 +0000 (14:50 +0300)] 
lib: failures - Use common log_prefix_add() for default and syslog formatters

7 years agolib: Add unit test for event log prefix handling
Timo Sirainen [Tue, 28 Aug 2018 09:45:23 +0000 (12:45 +0300)] 
lib: Add unit test for event log prefix handling

Some of the tests are commented out until they're fixed in a following
commit.

7 years agolib: failures - Move adding LF from default_format() to default_write()
Timo Sirainen [Fri, 31 Aug 2018 11:30:21 +0000 (14:30 +0300)] 
lib: failures - Move adding LF from default_format() to default_write()

This makes it similar to internal_format/write()

7 years agolib: Move failure handler structs and typedefs to failures-private.h
Timo Sirainen [Fri, 31 Aug 2018 11:21:06 +0000 (14:21 +0300)] 
lib: Move failure handler structs and typedefs to failures-private.h

Also change the function typedefs to be non-pointers, like they usually are
in Dovecot code.

7 years agolib: Make failure handler variables static
Timo Sirainen [Fri, 31 Aug 2018 11:19:32 +0000 (14:19 +0300)] 
lib: Make failure handler variables static

7 years agolib: Rename handler_config variable to failure_handler
Timo Sirainen [Fri, 31 Aug 2018 11:18:34 +0000 (14:18 +0300)] 
lib: Rename handler_config variable to failure_handler

It's a global variable, so it needs to have a proper prefix.

7 years agolib: Implement vfuncs for logging to stderr
Sergey Kitov [Thu, 14 Jun 2018 12:54:03 +0000 (15:54 +0300)] 
lib: Implement vfuncs for logging to stderr

7 years agolib: Implement vfuncs for logging to syslog
Sergey Kitov [Thu, 14 Jun 2018 12:49:41 +0000 (15:49 +0300)] 
lib: Implement vfuncs for logging to syslog

7 years agolib: Implement vfuncs for logging to default location and common failure logging...
Sergey Kitov [Sun, 5 Aug 2018 01:00:17 +0000 (04:00 +0300)] 
lib: Implement vfuncs for logging to default location and common failure logging handling

7 years agolib: Introduce abstraction for failure logging implementations.
Sergey Kitov [Tue, 12 Jun 2018 12:56:46 +0000 (15:56 +0300)] 
lib: Introduce abstraction for failure logging implementations.

7 years agolib-master: Fix crash when stats events are merged all the way to the root
Timo Sirainen [Mon, 3 Sep 2018 11:15:07 +0000 (14:15 +0300)] 
lib-master: Fix crash when stats events are merged all the way to the root

7 years agolib-master: stats_event_get_merged() - Remove unnecessary variable assignment
Timo Sirainen [Mon, 3 Sep 2018 10:14:39 +0000 (13:14 +0300)] 
lib-master: stats_event_get_merged() - Remove unnecessary variable assignment

Fixes scan-build complaint.

7 years agolib-master: stats_event_write use BEGIN only when event and parent_event create times...
Sergey Kitov [Tue, 16 Jan 2018 10:51:53 +0000 (12:51 +0200)] 
lib-master: stats_event_write use BEGIN only when event and parent_event create timestamps differ

7 years agolib: Add some event handling functions.
Sergey Kitov [Mon, 26 Feb 2018 14:33:19 +0000 (16:33 +0200)] 
lib: Add some event handling functions.

event_has_all_categories() - checks if given event contains all the
categories of an another event.
event_has_all_fields() - checks if given event contains all the fields
of an another event.
event_dup() - duplicates an event.
event_copy_categories_fields() - copies all categories and fields from
source to dest.

7 years agolib-http: client: peer: Log the number of pending connections consistently in relevan...
Stephan Bosch [Thu, 6 Sep 2018 01:40:55 +0000 (03:40 +0200)] 
lib-http: client: peer: Log the number of pending connections consistently in relevant debug messages.

Use the same style everywhere and log it where it makes sense.

7 years agolib-http: client: peer: Maintain a list of connections pending on behalf of a peer.
Stephan Bosch [Thu, 6 Sep 2018 01:33:59 +0000 (03:33 +0200)] 
lib-http: client: peer: Maintain a list of connections pending on behalf of a peer.

Before, pending connections were only listed in the peer pool.

7 years agolib-http: client: connection: Unlist the connection as pending immediately in http_cl...
Stephan Bosch [Thu, 6 Sep 2018 01:23:26 +0000 (03:23 +0200)] 
lib-http: client: connection: Unlist the connection as pending immediately in http_client_connection_failure().

7 years agolib-http: client: connection: Remove the connection from the peer pool pending list...
Stephan Bosch [Wed, 5 Sep 2018 23:57:43 +0000 (01:57 +0200)] 
lib-http: client: connection: Remove the connection from the peer pool pending list in a separate function.

7 years agolib-http: client: peer: Notify all peers in a peer pool about a successful connection.
Stephan Bosch [Thu, 6 Sep 2018 13:22:30 +0000 (15:22 +0200)] 
lib-http: client: peer: Notify all peers in a peer pool about a successful connection.

This allows peers for which the last connection attempt failed (which was not
the last pending attempt in the pool) to try again. This solves a problem that
could potentially cause a hang with multiple parallel clients creating serveral
new connections at once.

7 years agolib-http: client: peer: Add debug message for http_client_peer_connection_failure().
Stephan Bosch [Thu, 6 Sep 2018 14:03:58 +0000 (16:03 +0200)] 
lib-http: client: peer: Add debug message for http_client_peer_connection_failure().

7 years agolib-http: client: peer: Clarify debug message in http_client_peer_connection_failed_p...
Stephan Bosch [Thu, 6 Sep 2018 13:56:44 +0000 (15:56 +0200)] 
lib-http: client: peer: Clarify debug message in http_client_peer_connection_failed_pool().

7 years agolib-http: client: peer: Log debug message before calling peer pool in http_client_pee...
Stephan Bosch [Thu, 6 Sep 2018 13:54:02 +0000 (15:54 +0200)] 
lib-http: client: peer: Log debug message before calling peer pool in http_client_peer_connection_success().

7 years agolib-http: client: peer: Rename http_client_peer_connection_failed_any() to http_clien...
Stephan Bosch [Thu, 6 Sep 2018 13:50:36 +0000 (15:50 +0200)] 
lib-http: client: peer: Rename http_client_peer_connection_failed_any() to http_client_peer_connection_failed_pool().

7 years agolib-http: client: peer: Always run http_client_queue_connection_failure() upon defini...
Stephan Bosch [Thu, 6 Sep 2018 01:11:18 +0000 (03:11 +0200)] 
lib-http: client: peer: Always run http_client_queue_connection_failure() upon definitive connection failure.

The recorded peer->connecting flag was highly unreliable in a scenario involving
starting parallel connections. This way, the linked queues can update their
state accordingly. Also, this will not cause empty queues to initiate new
connection, because empty queues will do nothing after updating the connection
state.

This problem caused a client ioloop hang in high-load conditions.

7 years agolib-http: client: peer: Move http_client_peer_connection_failure().
Stephan Bosch [Thu, 6 Sep 2018 12:57:28 +0000 (14:57 +0200)] 
lib-http: client: peer: Move http_client_peer_connection_failure().

7 years agolib-http: client: queue: Do not fail claimed requests unless the queue is being destr...
Stephan Bosch [Thu, 6 Sep 2018 01:02:16 +0000 (03:02 +0200)] 
lib-http: client: queue: Do not fail claimed requests unless the queue is being destroyed.

Before, connection failure would also abort requests already being sent on
another connection, which is premature at best.