sapling/eden/fs/journal
Wez Furlong 36608c7820 explicitly complete StreamPublisher stream on destruct
Summary:
When running the watchman integration tests, I saw that some of them were
fataling here:

diffusion/FBS/browse/master/fbcode/thrift/lib/cpp2/async/StreamPublisher-inl.h$71

In this situation we're tearing down all the subscribers via
`Journal::cancelAllSubscribers` and this causes the stream be destroyed and
trigger this FATAL check.

We need to explicitly complete it before we can proceeed, so we do the gross
thing and call this in the destructor of a little wrapper.

This is made a little more complex because the disconnection handler has to
inform the Journal that it was torn down in the case where the client has
gone away.  The result is that we need to be careful to avoid the destructor
on Journal callback from running while we hold the Journal subscriber lock.

Reviewed By: strager

Differential Revision: D10024271

fbshipit-source-id: 06a9d40f7f6e46fe35ffcedba2669e27e6624427
2018-10-01 13:21:59 -07:00
..
test Fix stack overflow when destroying long Journal 2018-08-17 21:06:53 -07:00
CMakeLists.txt add CMake build files 2018-04-30 14:37:46 -07:00
Journal.cpp explicitly complete StreamPublisher stream on destruct 2018-10-01 13:21:59 -07:00
Journal.h Replace shared_ptr<JournalDelta> with a custom intrusive JournalDeltaPtr 2018-08-17 21:06:53 -07:00
JournalDelta.cpp Fix stack overflow when destroying long Journal 2018-08-17 21:06:53 -07:00
JournalDelta.h Fix stack overflow when destroying long Journal 2018-08-17 21:06:53 -07:00
JournalDeltaPtr.cpp Replace shared_ptr<JournalDelta> with a custom intrusive JournalDeltaPtr 2018-08-17 21:06:53 -07:00
JournalDeltaPtr.h Replace shared_ptr<JournalDelta> with a custom intrusive JournalDeltaPtr 2018-08-17 21:06:53 -07:00