Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions bd-client-stats-store/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ impl Collector {
})
})? {
MetricData::Counter(counter) => Ok(counter.clone()),
MetricData::Histogram(_) => unreachable!(),
MetricData::Histogram(_) => Err(Error::ChangedType),
}
}

Expand All @@ -576,7 +576,7 @@ impl Collector {
MetricData::Histogram(Histogram::default())
})? {
MetricData::Histogram(histogram) => Ok(histogram.clone()),
MetricData::Counter(_) => unreachable!(),
MetricData::Counter(_) => Err(Error::ChangedType),
}
}
}
1 change: 1 addition & 0 deletions bd-logger/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ bd-log-metadata.path = "../bd-log-metadata"
bd-log-primitives.path = "../bd-log-primitives"
bd-matcher.path = "../bd-matcher"
bd-network-quality.path = "../bd-network-quality"
bd-panic.path = "../bd-panic"
bd-proto.path = "../bd-proto"
bd-resource-utilization.path = "../bd-resource-utilization"
bd-runtime.path = "../bd-runtime"
Expand Down
2 changes: 2 additions & 0 deletions bd-logger/src/async_log_buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -750,9 +750,11 @@ impl<R: LogReplay + Send + 'static> AsyncLogBuffer<R> {
() = self.session_replay_recorder.run() => {},
() = self.events_listener.run() => {},
() = &mut local_shutdown => {
log::info!("LOCAL shutdown triggered, stopping async log buffer run loop");
return self;
},
() = &mut self_shutdown => {
log::info!("GLOBAL shutdown triggered, stopping async log buffer run loop");
return self;
},
}
Expand Down
38 changes: 34 additions & 4 deletions bd-logger/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ impl LoggerBuilder {
Pin<Box<impl Future<Output = anyhow::Result<()>> + 'static>>,
FlushTrigger,
)> {
bd_panic::default(bd_panic::PanicType::ForceAbort);
log::info!(
"bitdrift Capture SDK: {:?}",
self.params.static_metadata.sdk_version()
Expand Down Expand Up @@ -325,23 +326,47 @@ impl LoggerBuilder {
.collect();

try_join!(
async move { api.start().await },
async move {
api.start().await?;

log::info!("API ENDED");

Ok(())
},
async move { buffer_uploader.run().await },
async move {
async_log_buffer.run(crash_logs).await;

log::info!("ASYNC LOG ENDED");
Ok(())
},
async move {
buffer_manager.process_flushes(flush_buffers_rx).await?;

log::info!("BUFFER MANAGER ENDED");
Ok(())
},
async move { buffer_manager.process_flushes(flush_buffers_rx).await },
async move {
stats_flusher.periodic_flush().await;

log::info!("STATS FLUSHER ENDED");
Ok(())
},
async move {
crash_monitor.run().await?;

log::info!("CRASH MONITOR ENDED");
Ok(())
},
async move { crash_monitor.run().await },
async move {
artifact_uploader.run().await;
log::info!("ARTIFACT UPLOADER ENDED");
Ok(())
}
)
.inspect_err(|e| {
log::error!("Error running logger: {:?}", e);
})
.map(|_| ())
};

Expand Down Expand Up @@ -388,7 +413,12 @@ impl LoggerBuilder {
.build()
.unwrap()
.block_on(async {
handle_unexpected(f.await, "logger top level run loop");
let result = f.await;
log::info!(
"bitdrift runtime has finished running with result: {:?}",
result
);
handle_unexpected(result, "logger top level run loop");
});
})?;

Expand Down
Loading