Vsevolod Stakhov
79b0b67f2d
[Minor] Remove sequential algorithm as it is not actually a rotation alg
Sequential rotation was used just to rotate all upstreams in the loop (e.g.
when you need to do some action for all upstreams). Allowing to specify it as
a user defined algorithm was a mistake as it breaks upstreams API expectations.
See #4043
пре 2 година
Vsevolod Stakhov
49768177cf
[Minor] Allow to get a port for a specific upstream
пре 2 година
Vsevolod Stakhov
d53f283c4e
[Minor] Add one more check for use-after-free prevention
пре 2 година
Vsevolod Stakhov
e89fc35017
[Minor] Allow to capture upstream object
пре 2 година
Vsevolod Stakhov
41bfa9283e
[Rework] Try to resolve failed upstreams more agressively
пре 3 година
Vsevolod Stakhov
dbc9ff655d
[Fix] Fix round-robin rotation
пре 3 година
Vsevolod Stakhov
c2351037b5
[Feature] Support multiple base32 alphabets
пре 4 година
Vsevolod Stakhov
80bb5413db
[Fix] Fix listen socket parsing
Issue: #3254
пре 4 година
Vsevolod Stakhov
92abcea04f
[Project] Support mempool flags
пре 4 година
Vsevolod Stakhov
684996ee80
[Minor] Add failure reason in the upstreams code
пре 4 година
Vsevolod Stakhov
24f973e828
[Minor] Sequential upstreams iteration is special
пре 4 година
Vsevolod Stakhov
234923a5ff
[Feature] Allow exception when choosing upstream
пре 4 година
Vsevolod Stakhov
b802ca308b
[Minor] Improve logging
Submitted by: @citrin
пре 4 година
Vsevolod Stakhov
58e8c7ee5f
[Minor] Fix C stupidity
пре 4 година
Vsevolod Stakhov
ff7f417bff
[Fix] Allow real upstreams configuration
пре 4 година
Vsevolod Stakhov
9bde024ddf
[Minor] Improve logging for upstream failure
пре 4 година
Vsevolod Stakhov
ab2d0a0b1c
[Fix] Fix upstreams exclusion logic
пре 4 година
Vsevolod Stakhov
19e29ff61d
[Fix] Fix consistent hashing when upstreams are marked inactive
The idea is to rehash the value when we found that the current upstream is dead
and apply consistent hashing algorithm multiple times. This is limited by
number of attempts (we try 10 times before giving up). Also cleanup locking
stuff.
пре 4 година
Vsevolod Stakhov
61506d5279
[Project] Some fixes in SRV records handling
пре 4 година
Vsevolod Stakhov
b3eb4d1800
[Project] Start SRV upstreams implementation
пре 4 година
Vsevolod Stakhov
04127efeba
[Fix] Distinguish remote and local addrs parsing
пре 4 година
Vsevolod Stakhov
fdb077d507
[Minor] Add special assertions to avoid upstreams corruption
пре 4 година
Vsevolod Stakhov
b3713de7ce
[Fix] Fix pending checks for events
пре 4 година
Vsevolod Stakhov
a30f3afa46
[Minor] Fix dns servers upstreams
пре 4 година
Vsevolod Stakhov
f3d197ff3d
[Feature] Upstreams: Set noresolve flag on numeric upstreams
пре 4 година
Vsevolod Stakhov
44f911a006
[Feature] Upstreams: Add lazy resolving logic to all upstreams
пре 4 година
Vsevolod Stakhov
dc96f9b37f
[Project] Make it compileable again...
пре 5 година
Vsevolod Stakhov
005105a1b0
[Project] Rework upstreams
пре 5 година
Vsevolod Stakhov
98897c1797
[Project] First refactoring step libevent->libev
пре 5 година
Vsevolod Stakhov
2ad0276a31
[Minor] Pass variables from the environment to rspamd_env
пре 5 година
Vsevolod Stakhov
34cc551018
[Project] Preliminary support of HTTP proxies
Issue: #572
пре 5 година
Vsevolod Stakhov
5836e02b95
[Project] Allow to hash and compare inet addresses considering port
пре 5 година
Vsevolod Stakhov
81a0f3ca11
[Minor] Oops, fix type
пре 5 година
Vsevolod Stakhov
0f32df6f44
[Fix] Core: Fix address rotation bug
Previously, upstream.get_addr function returned the new address of the
upstream. Unfortunately, it was used for printing addresses. It caused
the following situation: let's imagine we have A1 and A2 where A1 was
initially selected. So the connection was performed to A1:
Current addr Selected addr
Connect+---------+ A2+------>A1 A1
|
+-+Print failure<---+ A1+------>A2 A2
| +----+
+->Mark failure+-------->+ A2 |
+----+
But the failure OP as well as log message told about `A2` where the real
problem happened with `A1`.
This commit adds distinguishing between getting the next and the current
address of the upstream resolving this issue.
пре 5 година
Vsevolod Stakhov
70d859cede
[Feature] Allow to add upstream watchers to Lua API
пре 5 година
Vsevolod Stakhov
a6a1a8d5ae
[Feature] Implement event watchers for upstreams
пре 5 година
Vsevolod Stakhov
6f84b92277
[Minor] Allow to create upstreams without a context
пре 5 година
Vsevolod Stakhov
ec763ca3ee
[Feature] Allow to set custom limits for upstream lists
пре 5 година
Vsevolod Stakhov
915a460b6a
[Minor] Fix event pending checks
пре 5 година
Vsevolod Stakhov
1812d38cb8
[Feature] Distinguish IP failures from connection failures
пре 5 година
Vsevolod Stakhov
4b7e987b91
[Minor] Allow to create upstream lists without rspamd_config
пре 6 година
Vsevolod Stakhov
deabe33977
[Fix] Fix upstream addrs updating
пре 6 година
Vsevolod Stakhov
34150e9a86
[Minor] Save nameserver name when parsing upstreams from resolv.conf
пре 6 година
Vsevolod Stakhov
f95d624720
[Minor] Add probabilistic reset of errors in upstream addrs
пре 6 година
Vsevolod Stakhov
cc52edf62c
[Fix] Delay upstream re-resolving when one upstream is defined
пре 6 година
Vsevolod Stakhov
758c39a8b7
[Fix] Do not constantly re-resolve failed upstreams with a single
element
пре 6 година
Vsevolod Stakhov
a479224582
[Minor] Further g_slice cleanup
пре 6 година
Vsevolod Stakhov
639c67dbd8
[Fix] Fix parsing IPv6 nameservers in resolv.conf
пре 7 година
Vsevolod Stakhov
f9e618dee3
[Minor] Add some auxiliary functions for upstreams
пре 7 година
Vsevolod Stakhov
81d002bdfe
[Fix] Reresolve upstreams even if there is a single server there
пре 7 година