]> git.ipfire.org Git - thirdparty/squid.git/commit
Reduce UDS/segment name clashes across same-service instances (#2023) v7
authorankor2023 <ankor2023@gmail.com>
Wed, 9 Jul 2025 17:45:19 +0000 (17:45 +0000)
committerAmos Jeffries <yadij@users.noreply.github.com>
Thu, 2 Oct 2025 22:56:39 +0000 (11:56 +1300)
commit9929f2cacfe86286e01a9c09b7db388b10de68a4
tree0f0c381f1d8273fb642f9eb23a19d9fe792b234b
parente35bd1889d0587cf204aac92f0271fddcb18b2fe
Reduce UDS/segment name clashes across same-service instances (#2023)

Add a PID file name hash to the names of the shared memory segments and
Unix Domain Sockets. Since all instances running on the same host are
supposed to have unique PID files, this addition significantly reduces
the probability of name clashes when running multiple Squid instances
with the same service name (i.e. the same `squid -n` parameter value
that defaults to "squid").

A clash may still happen if two different PID file names have the same
hash or if multiple instances disable PID file management with
`pid_filename none`. Clashes may also happen in environments where Squid
does not even use service name for naming shared memory segments.

Examples of UDS and shared memory segment names (while using default
service name):

    /var/run/squid/squid-SLWQ-kid-1.ipc
    /var/run/squid/squid-SLWQ-coordinator.ipc
    /dev/shm/squid-SLWQ-tls_session_cache.shm
    /dev/shm/squid-SLWQ-transients_map_slices.shm

This change is a reference point for automated CONTRIBUTORS updates.
CONTRIBUTORS
src/Instance.cc
src/Instance.h
src/Makefile.am
src/ipc/Port.cc
src/ipc/mem/Segment.cc
src/tests/Stub.am
src/tests/stub_Instance.cc [new file with mode: 0644]