Skip to content

Commit a7191f9

Browse files
cataphractclaude
authored andcommitted
Match SHM cache Integration type with sidecar writer
The sidecar's write_shm_file() serializes buffered_integrations as HashSet<Integration>, but the PHP-side reader in components-rs deserialized it as HashSet<String>. This mismatch has existed since the SHM cache was introduced in 91222ad ("feat: reduce telemetry sent", #3316), but was latent: config_sent was set true before any integrations appeared in SHM, and integration dedup (the only other consumer) was silently broken with the sidecar deduplicating server-side as a fallback. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d25b989 commit a7191f9

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

components-rs/telemetry.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ pub unsafe extern "C" fn ddog_sidecar_telemetry_add_integration_log_buffer(
256256

257257
pub struct ShmCache {
258258
pub config_sent: bool,
259-
pub integrations: HashSet<String>,
259+
pub integrations: HashSet<Integration>,
260260
pub composer_paths: HashSet<PathBuf>,
261261
pub last_endpoints_push: SystemTime,
262262
pub reader: OneWayShmReader<NamedShmHandle, CString>,
@@ -314,7 +314,7 @@ unsafe fn ddog_sidecar_telemetry_cache_get_or_update<'a>(
314314
}
315315

316316
if let Ok((config_sent, integrations, composer_paths, last_endpoints_push)) =
317-
bincode::deserialize::<(bool, HashSet<String>, HashSet<PathBuf>, SystemTime)>(buf)
317+
bincode::deserialize::<(bool, HashSet<Integration>, HashSet<PathBuf>, SystemTime)>(buf)
318318
{
319319
cache.config_sent = config_sent;
320320
cache.integrations = integrations;
@@ -365,7 +365,7 @@ pub unsafe extern "C" fn ddog_sidecar_telemetry_filter_flush(
365365
.into_iter()
366366
.filter(|action| match action {
367367
SidecarAction::Telemetry(TelemetryActions::AddIntegration(integration)) => {
368-
!cache_entry.integrations.contains(&integration.name)
368+
!cache_entry.integrations.contains(integration)
369369
}
370370
SidecarAction::PhpComposerTelemetryFile(path) => {
371371
!cache_entry.composer_paths.contains(path)

0 commit comments

Comments
 (0)