aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/nghttp2/lib/nghttp2_alpn.h
diff options
context:
space:
mode:
authorarkady-e1ppa <arkady-e1ppa@yandex-team.com>2024-05-27 11:31:21 +0300
committerarkady-e1ppa <arkady-e1ppa@yandex-team.com>2024-05-27 11:44:57 +0300
commit89f880c2c27de159962127b46e71fed21d21f7db (patch)
tree5b2326652356602bdec4a31d6a88cdea3a6b30b3 /contrib/libs/nghttp2/lib/nghttp2_alpn.h
parent8252f93d81626e09c191953f7616eacd16721565 (diff)
downloadydb-89f880c2c27de159962127b46e71fed21d21f7db.tar.gz
YT-21634: Make shutdown sequences of Invokers more robust
Basically, there are two bugs/bad behaviors: 1) Some parts of shutdown are delegated to Finalizer/Shutdown invoker. This causes a race (not a data race, just non-deterministic behaviour) between deadlocking producer (if destruction of their callback causes a deadlock) and a finalizer/shutdown thread who closes the queue triggering deadlock event. We change behaviour so that queues are closed immediately thus if any deadlocks are present, they are guaranteed to happen and be reliably detected. 2) Most queues that implement a shutdown mechanism, do not have a proper way of double checking if queue was closed after they've checked previously but before they enqueued their task. This results in a callback being stuck in queue forever. On its own this is not an issues, but given the fact that callback can and usually does hold a strong reference to the class which usually owns the queue itself, we have a reference cycle queue -owns-> callback -owns-> queue. We implement appropriate double checking mechanics which ensure such a think never occurs. ad8c42eb67f74bc19c32c85fd8b7790b294a7144
Diffstat (limited to 'contrib/libs/nghttp2/lib/nghttp2_alpn.h')
0 files changed, 0 insertions, 0 deletions