telemetry: fix socket path conflicts for in-memory mode
authorBruce Richardson <bruce.richardson@intel.com>
Thu, 14 Oct 2021 10:49:05 +0000 (11:49 +0100)
committerDavid Marchand <david.marchand@redhat.com>
Thu, 14 Oct 2021 18:31:10 +0000 (20:31 +0200)
commit85e21b77d8b6b7790a15f32817ede6d5e65af95b
treeed3b4167af8f8961eb4ef135dc844ee224062264
parente89463a36604c9fded482b0c1b066e90ef69d50f
telemetry: fix socket path conflicts for in-memory mode

When running using in-memory mode, multiple processes can use the same
runtime dir, leading to conflicts with the telemetry sockets in that
directory. We can resolve this by appending a suffix to each socket
beyond the first, with the suffix being an increasing counter value.
Each process uses the first unused socket counter value.

Fixes: 6dd571fd07c3 ("telemetry: introduce new functionality")

Reported-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
Tested-by: Conor Walsh <conor.walsh@intel.com>
lib/telemetry/telemetry.c