pleroma/lib/pleroma
Lain Soykaf 24bdd9774a
fix(reverse_proxy): release the HTTP client on every outcome
Three paths obtained a client ref and abandoned it without closing:
the content-length rejection in call/3, the invalid-status clause in
request/4, and the success branch of response/6.

Under Hackney 4 an abandoned ref is a permanent process leak. A conn
that finishes or errors without an explicit stop parks in `closed` or
`connected` and never terminates: closed/3 only arms its stop timer for
pooled conns, `connected` gets no state_timeout when idle_timeout is
infinity, and a non-pooled conn monitors hackney_conn_sup rather than
its caller, so the owner-DOWN cleanup never fires. Each parked process
pins every refc binary it read, which for proxied video is tens of MB.

Releasing on every outcome means the gun client must stop releasing in
stream_body/1, or the ref would be removed twice.

Hackney does reclaim a pooled connection itself for a response that
cannot carry a body (204, 304, HEAD), so those refs are marked and left
alone; stopping one would evict a connection another request may
already hold. The mark is gated on the request actually being pooled,
since a direct or proxy-tunnelled conn is never checked in and leaks
unless we stop it.
2026-07-25 18:46:43 +04:00
..
activity Do not use Enum.map for side-effects 2026-02-27 16:24:10 +01:00
captcha Fix some more typos 2023-12-28 00:17:04 +01:00
chat Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
config Mogrify/Mogrifun: Asyncify 2025-02-25 17:08:21 +04:00
conversation Add missing type 2024-07-22 15:32:20 -04:00
date_time Linting 2025-03-11 18:21:27 +04:00
docs Fix invalid type 2024-01-20 17:05:55 -05:00
ecto_type ConfigDB, RateLimiter, RateLimit: Use new type to parse and cast rate limits. 2026-01-06 16:34:17 +04:00
emails Remove WorkerHelper 2024-07-30 11:34:48 -04:00
emoji Emoji: Handle more edge cases for local emoji with strange filenames. 2026-01-06 15:12:49 +04:00
gopher Gopher: Fix crash on (re)boot when ConfigDB is enabled 2026-02-17 00:47:57 +01:00
gun Switch the reclaimer to GenServer.start so it is not linked 2024-06-20 14:17:28 -04:00
helpers Dialyzer: fix pattern matches preventing video thumbnailing from working 2024-05-28 10:19:22 -04:00
http fix(http): harden Hackney request lifecycle 2026-07-22 16:18:04 +04:00
instances Rename Instance.delete_users_and_activities/1 to Instance.delete/1 2025-06-28 13:37:06 -07:00
language Merge remote-tracking branch 'origin/develop' into translation-provider-translatelocally 2025-11-28 15:07:43 +01:00
mfa lint 2026-03-25 11:14:42 -07:00
migration_helper Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
migrators Pleroma.Migrators.Support.BaseMigrator: Fix dialyzer errors 2024-01-22 18:37:13 -05:00
object Update voters count in remote polls when refreshing 2025-09-27 10:50:51 +02:00
password Fix atom leak in password digest functionality 2024-02-14 17:54:56 -05:00
reverse_proxy fix(reverse_proxy): release the HTTP client on every outcome 2026-07-25 18:46:43 +04:00
search Move object_to_search_data/1 to Pleroma.Search 2026-03-25 14:47:39 -07:00
signature PublisherTest: Use mox instead of mock. 2025-09-05 14:18:12 +04:00
telemetry Change Gun connection pool logs to debug 2024-06-28 10:23:02 -04:00
tesla/middleware Move custom URI encoding functions to Pleroma.Utils.URIEncoding 2025-12-10 14:56:05 +01:00
tests Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
upload StripLocation, ReadDescription: Silence noisy errors. 2026-01-08 13:40:25 +04:00
uploaders File.mkdir_p -> Pleroma.Backports.mkdir_p 2025-06-16 12:48:47 +02:00
user Merge pull request 'Better user search' (#7793) from gitlab-mr-iid-4416 into develop 2026-05-13 09:53:52 +00:00
utils Make URI encoding query quirks host-aware 2025-12-10 14:56:06 +01:00
web fix(formatter): preserve remote MFM mentions 2026-07-22 14:17:17 +04:00
workers SignatureRetryWorker: require validated host header 2026-05-13 00:32:54 +02:00
activity.ex Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
announcement.ex Announcement: fix dialyzer errors and add typespec for the changeset 2024-01-22 18:37:13 -05:00
announcement_read_relationship.ex Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
application.ex Fix formatting 2025-06-04 12:03:54 +03:00
application_requirements.ex Merge remote-tracking branch 'origin/develop' into translate-posts 2025-03-19 17:59:24 +01:00
backports.ex backports: Copy mkdir_p TOCTOU fix from elixir PR 14242 2025-06-16 12:46:00 +02:00
bookmark.ex Various bookmark folders-related improvements 2026-03-02 23:41:46 +01:00
bookmark_folder.ex Various bookmark folders-related improvements 2026-03-02 23:41:46 +01:00
caching.ex Pleroma.Web.RichMedia.Parser: Remove test-specific codepaths 2024-02-06 18:33:54 -05:00
captcha.ex Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
chat.ex Pin/unpin chats 2025-11-29 16:53:56 +01:00
clippy.ex Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
config.ex Mogrify/Mogrifun: Asyncify 2025-02-25 17:08:21 +04:00
config_db.ex ConfigDB, RateLimiter, RateLimit: Use new type to parse and cast rate limits. 2026-01-06 16:34:17 +04:00
constants.ex constants: remove favicon.png from static_only_files 2026-03-05 20:21:19 +00:00
conversation.ex Credo.Check.Readability.PredicateFunctionNames 2024-01-26 16:59:58 -05:00
counter_cache.ex Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
data_migration.ex Pleroma.Migrators.Support.BaseMigratorState: fix dialyzer error 2024-01-22 18:37:13 -05:00
date_time.ex Linting 2025-03-11 18:21:27 +04:00
delivery.ex Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
ecto_enums.ex Refactor backups to be fully controlled by Oban 2024-07-23 10:30:40 -04:00
emoji-test.txt emoji-test: update to latest 15.0 draft 2022-08-20 00:21:07 +02:00
emoji.ex Emoji, AccountView, UtilController: Handle encoding of emoji 2026-01-07 10:40:45 +04:00
filter.ex Remove WorkerHelper 2024-07-30 11:34:48 -04:00
following_relationship.ex paginate follow requests (#460) 2026-01-07 15:32:16 +01:00
formatter.ex fix(deps): replace mdex with earmark parser 2026-07-23 13:02:28 +04:00
frontend.ex Update Pleroma-FE build artifacts URL 2026-05-06 13:55:45 +00:00
gun.ex Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
hashtag.ex Credo 2025-08-01 10:41:53 -07:00
healthcheck.ex Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
html.ex RichMedia refactor 2024-05-07 19:54:56 -04:00
http.ex Move custom URI encoding functions to Pleroma.Utils.URIEncoding 2025-12-10 14:56:05 +01:00
http_signatures_api.ex HTTPSignaturePlugTest: Rewrite to use mox. 2024-05-28 14:00:25 +04:00
instances.ex Rename Instance.delete_users_and_activities/1 to Instance.delete/1 2025-06-28 13:37:06 -07:00
job_queue_monitor.ex Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
jwt.ex Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
keys.ex Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
ldap.ex Reorganize the LDAP module 2024-10-11 15:51:56 -04:00
list.ex Allow attaching emojis to user lists 2026-06-23 16:08:52 +02:00
logging.ex Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
maintenance.ex Elixir 1.15: Chase the Logger.warn deprecation 2023-12-20 20:16:26 +00:00
maps.ex Use Map.filter now that minimum Elixir version is 1.13 2024-08-21 14:50:19 -04:00
marker.ex Elixir 1.19: Only match once on structs 2026-03-25 11:11:17 -07:00
mfa.ex Pleroma.MFA: fix gradient error 2024-02-02 12:14:15 -05:00
moderation_log.ex Allow assigning users to reports 2026-01-28 10:35:19 +01:00
mogrify_behaviour.ex Linting 2025-03-11 18:21:27 +04:00
mogrify_wrapper.ex Linting 2025-03-11 18:21:27 +04:00
notification.ex Persist notification group keys 2026-05-23 11:38:33 +04:00
object.ex Fix votersCount inflation in multiple-choice polls 2026-05-06 11:33:34 +04:00
object_tombstone.ex Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
pagination.ex provide full replies collection in ActivityPub objects 2025-10-09 15:15:16 +02:00
password_reset_token.ex Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
prom_ex.ex Switch to PromEx for prometheus metrics 2023-11-13 15:34:59 -05:00
registration.ex Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
release_tasks.ex pleroma_ctl: Properly handle user arguments with whitespace 2026-04-24 18:04:31 +02:00
repo.ex Switch to PromEx for prometheus metrics 2023-11-13 15:34:59 -05:00
report_note.ex Fix invalid typespec references to Ecto.Changeset.t() 2024-01-20 16:47:50 -05:00
reverse_proxy.ex fix(reverse_proxy): release the HTTP client on every outcome 2026-07-25 18:46:43 +04:00
rule.ex Add hint to rules 2024-04-06 11:45:19 +02:00
safe_zip.ex Fix dialyzer error in safe_zip: Remove impossible pattern match for {:get_type, _e} 2025-07-22 15:21:20 -07:00
scheduled_activity.ex Oban queue simplification 2024-05-27 13:48:17 -04:00
search.ex Move object_to_search_data/1 to Pleroma.Search 2026-03-25 14:47:39 -07:00
signature.ex Signature: Treat HTTP signature errors as invalid 2026-05-12 08:52:42 +04:00
stats.ex Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
thread_mute.ex Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
upload.ex Elixir 1.19: Fix typing violation on struct updates in Pleroma.Upload 2026-03-25 11:09:10 -07:00
user.ex paginate follow requests (#460) 2026-01-07 15:32:16 +01:00
user_invite_token.ex Fix invalid typespec references to Ecto.Changeset.t() 2024-01-20 16:47:50 -05:00
user_note.ex Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
user_relationship.ex MastoAPI AccountView: Add mute/block expiry to the relationship object 2026-01-28 13:49:34 +01:00
utils.ex Elixir 1.19: Fix deprecation warning when invoking ParallelCompiler 2026-03-25 11:11:38 -07:00
web.ex Fix Phoenix upstream migration regressions 2026-05-11 22:14:01 +04:00
xml_builder.ex Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00