Commit Graph

18 Commits

Author SHA1 Message Date
Haelwenn (lanodan) Monnier a17910a6c6
CI: Bump lint stage to elixir-1.12
Elixir 1.12 changed formatting rules, this allows to avoid having to rollback to run `mix format`
2021-10-06 08:11:05 +02:00
Haelwenn (lanodan) Monnier c4439c630f
Bump Copyright to 2021
grep -rl '# Copyright © .* Pleroma' * | xargs sed -i 's;Copyright © .* Pleroma .*;Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>;'
2021-01-13 07:49:50 +01:00
rinpatch 89a7efab69 ConnectionPool: Log possible HTTP1 blocks 2020-09-11 15:37:39 +03:00
Alexander Strizhakov a83916fdac
adapter options unification
not needed options deletion
2020-09-07 19:59:17 +03:00
href afd378f84c host is now useless 2020-07-15 15:26:35 +03:00
href ce1a42bd04 Simplify TLS opts
- `verify_fun` is not useful now
- use `customize_check_hostname` (OTP 20+ so OK)
- `partial_chain` is useless as of OTP 21.1 (wasn't there, but hackney/..
uses it)
2020-07-15 15:26:35 +03:00
rinpatch 007843b75e Add documentation for new connection pool settings and remove some
`:retry_timeout` and `:retry` got removed because reconnecting on failure is
something the new pool intentionally doesn't do.

`:max_overflow` had to go in favor of `:max_waiting`, I didn't reuse the key because
the settings are very different in their behaviour.

`:checkin_timeout` got removed in favor of `:connection_acquisition_wait`,
I didn't reuse the key because the settings are somewhat different.

I didn't do any migrations/deprecation warnings/changelog entries because
these settings were never in stable.
2020-07-15 15:26:35 +03:00
rinpatch 58a4f350a8 Refactor gun pooling and simplify adapter option insertion
This patch refactors gun pooling to use Elixir process registry and
simplifies adapter option insertion.

Having the pool use process registry instead of a GenServer has a number of advantages:
- Simpler code: the initial implementation adds about half the lines of code it deletes
- Concurrency: unlike a GenServer, ETS-based registry can handle multiple checkout/checkin
requests at the same time
- Precise and easy idle connection clousure: current proposal for closing idle connections in
the GenServer-based pool needs to filter through all connections once a minute and compare their
last active time with closing time. With Elixir process registry this can be done
by just using `Process.send_after`/`Process.cancel_timer` in the worker process.
- Lower memory footprint: In my tests `gun-memory-leak` branch uses about 290mb on peak load (250 connections)
and 235mb on idle (5-10 connections). Registry-based pool uses 210mb on idle and 240mb on peak load
2020-07-15 15:17:27 +03:00
Alexander Strizhakov 5739c498c0
fix for gun connections pool 2020-04-08 18:46:01 +03:00
Alexander Strizhakov 1306b92997
clean up 2020-03-12 18:29:07 +03:00
Alexander Strizhakov f39e1b9eff
add verify tls_opts only when we open connection
for other requests tesla will add tls_opts
2020-03-10 15:54:11 +03:00
Alexander Strizhakov 884d9710b2
refactoring for gun api modules 2020-03-03 19:24:14 +03:00
Alexander Strizhakov 8854770fc4
retry and retry_timeout settings default change 2020-03-03 18:01:35 +03:00
Alexander Strizhakov 8fc00b7cbf
return error if connection failed to open 2020-03-03 16:42:24 +03:00
Alexander Strizhakov 7d68924e4f
naming 2020-03-03 16:42:24 +03:00
Alexander Strizhakov e605e79df9
simplification of formatting host method
case for format_proxy method
2020-03-03 16:42:03 +03:00
Alexander Strizhakov 8efae966b1
open conn in separate task 2020-02-24 19:56:27 +03:00
Alexander Strizhakov 514c899275
adding gun adapter 2020-02-18 08:19:01 +03:00