Commit graph

6 commits

Author SHA1 Message Date
fox.cpp
a4b4706dbb
module: Allow config blocks to have more than one name
This allows more readable configuration files without additional
explanations in cases where a single module is used for multiple
purposes.

Also cleans up certain problems with modules that rely on block
names having certain semantics (e.g. endpoint modules).
2019-08-27 19:39:49 +03:00
fox.cpp
d1df9f60be
queue: Fix race-conditions in queue tests
Improper queue initialization by filling fields manually instead of
calling NewQueue resulted in Queue objects created in tests having
no workersStop channel (nil), making Queue.Close no-op. This caused
race-conditions because test code assumes that Queue.Close will wait
for queue goroutines to stop before returning.

Queue late-initialization logic is factored out into Queue.start
function. Now newTestQueueDir calls NewQueue, modifies fields of
returned object and calls Queue.start.
2019-08-27 02:06:13 +03:00
fox.cpp
bd918fb4d9
all: Rename module and update imports 2019-08-25 20:32:53 +03:00
fox.cpp
36df546193 Rename DeliveryContext to MsgMetadata, update docs
The name "context" is also used for several other entities. This is
simply confusing. We are getting rid of that fancy word and will leave
it only for context.Context.

Additionally, with the introduction of the new interfaces for most
stuff DeliveryContext struct is no longer used to pass arbitrary
data between modules, it now contains mostly message meta-data and
a few flags, though the latter is now discouraged because it may
lead to problems with concurrency.

Additionally, documentation for some fields in the structure was wrong.

The field DeliveryID is simply renamed to ID for clarity.
2019-08-25 20:23:13 +03:00
fox.cpp
d07d656472 buffer: Move to a separate package
The module package is meant for interfaces implemented by modules and is
not a catch-all for all utilities.
2019-08-25 20:23:13 +03:00
fox.cpp
dfeddffec7 queue: Rewrite to implement new delivery target interface
Since queue was too tightly coupled to the old interface. This commit
is basically the ground-up rewrite. I took this chance to add proper
tests and create a cleaner implementation in general.

Below is the list of small modifications to the overall queue design.

* Successful field is removed from PartialError since it turned out to
be redundant.

* testerLog utility is updated to be more useful with t.Parallel()
(used for queue log). Wrapping t.Log makes testing framework associate
log output with tests and output it in right order.

* Message header is now stored in a separate file. This is done instead
of implementing hacks for module.FileBuffer to skip header on each Open.

* Queue.Close now properly waits for workers to stop. It caused problems
with tests where I call Close while queue is attempting delivery.

* Previous failures are stored in QueueMetadata for future use in
bounce messages.
2019-08-25 20:23:13 +03:00