diff options
author | Daniele Di Proietto <ddiproietto@google.com> | 2023-10-27 16:57:21 +0000 |
---|---|---|
committer | Primiano Tucci <primiano@google.com> | 2023-10-30 12:35:41 +0000 |
commit | 137c5a9438e785c3680be977e88c0f91bf73e065 (patch) | |
tree | 920839e8d8d51be44eff6dc54e5241835f37eaa4 | |
parent | 11b08e6fcd3ab6a8cd879a7a47da4764e0ae8700 (diff) | |
download | perfetto-chromium/6045.tar.gz |
tracing: Avoid sending delayed Flush Ack to reconnected producerchromium/6045
If the tracing service disconnects and reconnects while a data source is
handling a flush request, there's no point is sending the flush reply to
the newly reconnected producer.
Found by inspection while investigating a similar problem in
crbug.com/1495261
Change-Id: Ia81723e97b1eb32212901ee4b205eb50c2e08b27
(cherry picked from commit d049a7766b7794ce2a5b75a07f40f4e0624a487d)
-rw-r--r-- | src/tracing/internal/tracing_muxer_impl.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/tracing/internal/tracing_muxer_impl.cc b/src/tracing/internal/tracing_muxer_impl.cc index 41dbf5d13..c0d88acab 100644 --- a/src/tracing/internal/tracing_muxer_impl.cc +++ b/src/tracing/internal/tracing_muxer_impl.cc @@ -1708,7 +1708,12 @@ void TracingMuxerImpl::FlushDataSource_AsyncEnd( if (!producer) return; - if (producer->connected_) { + // If the tracing service disconnects and reconnects while a data source is + // handling a flush request, there's no point is sending the flush reply to + // the newly reconnected producer. + if (producer->connected_ && + backend.producer->connection_id_.load(std::memory_order_relaxed) == + backend_connection_id) { producer->NotifyFlushForDataSourceDone(instance_id, flush_id); } } |