Skip to content

Commit

Permalink
Minor fix to BEP key encoding (#1539)
Browse files Browse the repository at this point in the history
LifetimeEvents and BuildEvents were racing to who would get the
entry first. This partitions the data.
  • Loading branch information
allada authored Dec 14, 2024
1 parent 55a49f3 commit c742302
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions nativelink-service/src/bep_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ impl BepServer {
let sequence_number = build_event.sequence_number;

let store_key = StoreKey::Str(Cow::Owned(format!(
"BepEvent:{}:{}:{}",
"BepEvent:le:{}:{}:{}",
&stream_id.build_id, &stream_id.invocation_id, sequence_number,
)));

Expand Down Expand Up @@ -140,7 +140,7 @@ impl BepServer {
store
.update_oneshot(
StoreKey::Str(Cow::Owned(format!(
"BepEvent:{}:{}:{}",
"BepEvent:be:{}:{}:{}",
&stream_id.build_id, &stream_id.invocation_id, sequence_number,
))),
buf.freeze(),
Expand Down
4 changes: 2 additions & 2 deletions nativelink-service/tests/bep_server_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ async fn publish_lifecycle_event_test() -> Result<(), Box<dyn std::error::Error>
let sequence_number = request.clone().build_event.unwrap().sequence_number;

let store_key = StoreKey::Str(Cow::Owned(format!(
"BepEvent:{}:{}:{}",
"BepEvent:le:{}:{}:{}",
stream_id.clone().build_id,
stream_id.clone().invocation_id,
sequence_number
Expand Down Expand Up @@ -287,7 +287,7 @@ async fn publish_build_tool_event_stream_test() -> Result<(), Box<dyn std::error
.iter()
.map(|request| {
StoreKey::Str(Cow::Owned(format!(
"BepEvent:{}:{}:{}",
"BepEvent:be:{}:{}:{}",
stream_id.build_id,
stream_id.invocation_id,
request
Expand Down

0 comments on commit c742302

Please sign in to comment.