Re: unique IDs for connections to ipsvd programs
Lasse Kliemann <[email protected]>
| Newsgroups | gmane.comp.misc.pape.general |
|---|---|
| Message-ID | <[email protected]> |
* Message by -Charlie Brady- from Tue 2007-11-13: > > On Tue, 13 Nov 2007, Lasse Kliemann wrote: > >> * Message by -Charlie Brady- from Mon 2007-11-12: >>> >>> On Thu, 8 Nov 2007, Lasse Kliemann wrote: >>> >>>> That's the problem. With many concurrent connections, these outputs will >>>> be garbled. >>> >>> In what sense would they be/are they garbled? >> >> Example: >> >> tcpsvd 0 2000 sh -c 'echo -n "$$: " >&2 ; uuidgen >&2' >> >> Now I start hammering this service with requests. >> Here is what can happen to the output: >> >> 9804: b0861e71-8143-4d43-851d-6df5acc8fb44 >> 9809: c07a8d79-aa10-43fd-8104-1626e9dad863 >> 9810: 9814: fb968e73-5765-49df-8353-02ea0cd1d812 >> 3646ac5e-c147-44ca-abcb-a5a84e087c0e >> 9818: f0312d9d-a83e-4497-b80c-4ea3537c5a6b > > The problem here is that you have two half lines written by different > processes. Don't do that, and you are much less likely to have interleaved > logs. Have your process write full log lines in a single write and you will > never see interleaved logs. > > What do you see if you do: > > tcpsvd 0 2000 sh -c 'echo "$$:" $(uuidgen) >&2' I could not reproduce the above problem with this construct. First of all, thanks for the advice! What magnitude is the probability of that I will still get interleaved logs with this solution? Is it like the same order of magnitude as the probability that, say, uuidgen will generate the same ID twice? Then it would not matter.
signature.asc
(application/pgp-signature, 827 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) iQIVAwUBRzsIt1Yll6N4nhdvAQJUag//bLfXBpwtIkiQKvH1xHh/yZ0gRuFhBR3Z jQRRRPJmx9dT97cG3wl9RkvqWPY4d5w3wB78VGJAZB8Qu/2A2W7hh873jKnPP/VM yE6lcplZbf/nc8rKSocnk8JwxmdvY8qCNhz54i9/LY/vWBVzKGYfofR5zgjcPTRz AuARcHMwEphSQtt+Ff9yVR5CMnymasUcp1xOWFhALLaOr723GyNkcRfkrDKchbGJ raYgYeMCxcm2GLjQ43qyfnChnKTJgeyc4p5/gp021zlaneJgLTLBJchO0IGtUyT/ Plz/eLCb5jxlrM2WivYpCwfJYSngQwBe6t034q1+CUxhVsoqIYrbgbwGN3gaRWc/ uyhFYdf1Y9rlVd1b1MsfBJmdPEjR+lRS3wI4r8kLyC9vIm44UzQuYbyROVAo4YK+ U2oHxzJx3JDZp7eDzHaoG488QA+g7o0wYO6w4aNUR/Aqj0bqRoZcwzv5gge+vkdz S/YySaVDQsjH70IGpF3DU6hVaNTT1gL5cZ6+tB3h0+z+vzgAqHFfh6J1qiDGivv4 34YaYXA3c33OcHos+OXx2aCCyU9tF3ZnsqSfz/6xGwnODnuhFQDbb5kcRNs7NWJ0 AKyLKlWzbpua+RF2O6aJhCNg/VD4hh2ljECNDEKsP1NP/M+s0KgtXUu24hdXwOgt G9ycAKJ0kRc= =Y+A9 -----END PGP SIGNATURE-----