diff options
author | Sverker Eriksson <sverker@erlang.org> | 2018-03-01 17:56:01 +0100 |
---|---|---|
committer | Sverker Eriksson <sverker@erlang.org> | 2018-03-02 19:16:48 +0100 |
commit | 96aba63465135d5e2537b42e5167b2863957915c (patch) | |
tree | 033e373c6707ab288a2fdfbe5fd47db9d6bfad14 /erts/emulator/beam/dist.c | |
parent | b31750711daa35011c62898d2eb424332e170bcc (diff) | |
download | otp-96aba63465135d5e2537b42e5167b2863957915c.tar.gz otp-96aba63465135d5e2537b42e5167b2863957915c.tar.bz2 otp-96aba63465135d5e2537b42e5167b2863957915c.zip |
erts: Postpone idle DistEntry until abort is completed
Diffstat (limited to 'erts/emulator/beam/dist.c')
-rw-r--r-- | erts/emulator/beam/dist.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/erts/emulator/beam/dist.c b/erts/emulator/beam/dist.c index f5491fd92a..cd799e04b8 100644 --- a/erts/emulator/beam/dist.c +++ b/erts/emulator/beam/dist.c @@ -3630,6 +3630,17 @@ static Sint abort_connection(DistEntry* dep, Uint32 conn_id) delete_cache(cache); free_de_out_queues(dep, obuf); + + /* + * We wait to make DistEntry idle and accept new connection attempts + * until all is cleared and deallocated. This to get some back pressure + * against repeated failing connection attempts saturating all CPUs + * with cleanup jobs. + */ + erts_de_rwlock(dep); + ASSERT(dep->state == ERTS_DE_STATE_EXITING); + dep->state = ERTS_DE_STATE_IDLE; + erts_de_rwunlock(dep); return reds; } erts_de_rwunlock(dep); |