Skip to content

Commit

Permalink
fix(backend-native): Fix request sequence span ids (#9077)
Browse files Browse the repository at this point in the history
  • Loading branch information
KSDaemon authored Jan 8, 2025
1 parent c97526f commit d48ef99
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/cubejs-backend-native/src/transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,10 +347,13 @@ impl TransportService for NodeBridgeTransport {
.map(|s| s.span_id.clone())
.unwrap_or_else(|| Uuid::new_v4().to_string());

let mut req_seq_id: u32 = 0;

loop {
req_seq_id += 1;
let extra = serde_json::to_string(&LoadRequest {
request: TransportRequest {
id: format!("{}-span-{}", request_id, 1),
id: format!("{}-span-{}", request_id, req_seq_id),
meta: Some(meta.clone()),
},
query: query.clone(),
Expand Down Expand Up @@ -433,15 +436,19 @@ impl TransportService for NodeBridgeTransport {
.as_ref()
.map(|s| s.span_id.clone())
.unwrap_or_else(|| Uuid::new_v4().to_string());

let mut req_seq_id: u32 = 0;

loop {
req_seq_id += 1;
let native_auth = ctx
.as_any()
.downcast_ref::<NativeAuthContext>()
.expect("Unable to cast AuthContext to NativeAuthContext");

let extra = serde_json::to_string(&LoadRequest {
request: TransportRequest {
id: format!("{}-span-{}", request_id, 1),
id: format!("{}-span-{}", request_id, req_seq_id),
meta: Some(meta.clone()),
},
query: query.clone(),
Expand Down

0 comments on commit d48ef99

Please sign in to comment.