Tracing: active tracing at shutdown
If the reader of the stream stops reading from it for some reason, a deadlock is possible: - WriteToStream() obtains stream_lock_ but does not release it because it is blocked on writing to the stream that is not read from. - CloseStream() does not close the stream because it waits on the lock that WriteToStream() is not releasing. I will remove the lock alltogether. So, CloseStream() does not wait and just closes the stream. Then, if the BlockingCopyFromString() statement of WriteToStream() is blocked, it will be signaled that the stream is closed. It is not a perfect solution because if CloseStream() closes the stream after the "if (stream_.is_valid())" check of WriteToStream() but before BlockingCopyFromString() reaches the wait statement, the stream handle becomes invalid and a DCHECK will fail. I cannot think of a simple solution right now, but the above-mentioned scenario is very unlikely to happen. For sure, this CL improves the current flakiness. Bug: 837215 Change-Id: I5d064b93dfb6af444c778bb60f156b29b43f1617 Reviewed-on: https://chromium-review.googlesource.com/1054092 Commit-Queue: Ehsan Chiniforooshan <chiniforooshan@chromium.org> Reviewed-by:oysteine <oysteine@chromium.org> Cr-Commit-Position: refs/heads/master@{#557677}
Showing
Please register or sign in to comment