>>> Jan Pokorný <[email protected]> schrieb am 29.04.2019 um 17:22 in Nachricht <[email protected]>: > On 29/04/19 14:58 +0200, Jan Pokorný wrote: >> On 29/04/19 08:20 +0200, Ulrich Windl wrote: >>>>>> Jan Pokorný <[email protected]> schrieb am 25.04.2019 um 18:49 >>>>>> in Nachricht <[email protected]>: >>>> I think the prime and foremost use case is that half of the actual >>>> pacemaker daemons run as hacluster:haclient themselves, and it's >>>> preferred for them to be not completely muted about what they do, >>>> correct? :‑) >>> >>> I interesting aspect: So the commands write directly to one file >>> concurrently? How's synchronization done. It's especially >>> interesting with multiple threads. >> >> You don't believe your libc (fprintf in particular) to abide the >> POSIX constraints, do you? :-) >> >>> All functions that reference (FILE *) objects, except those with >>> names ending in _unlocked, shall behave as if they use flockfile() >>> and funlockfile() internally to obtain ownership of these (FILE *) >>> objects. >> >> [https://pubs.opengroup.org/onlinepubs/9699919799/functions/flockfile.html] >> >>> Wouldn't it be much easier to use some socket-bases syslog like >>> service that serializes all the messages to one file. Then the >>> clients just need write access to the socket, not to the files.
I agree thst multiple threads in one thread have no problem using printf(), but (at least in the buffered case) if multiple processes write to the same file, that type of locking doesn't help much IMHO. (In clasical syslog there's _one_ process that receives the messages and writes them to files. I can only remember HP-UX kernel messages that were synchronized byte-wise, so if multiple cores emitted the same message concurrently you go some funny messages like "OpOpeeniingng"... ;_) > > FWIW, have just realized that by virtue of this, we have actually > silently alleviated a hidden lock contention (against the realtime > corosync process! but allegedly, it is not too verbose if nothing > interesting happens unless set to be more verbose) since > Pacemaker-2.0.0: > > https://github.com/ClusterLabs/pacemaker/commit/b8075c86d35f3d37b0cbac86a8c9 > 0f1ac1091c33 > > Great! > > But we can do better for those who would prefer to serialize > multiple (per daemon) file outputs by hand (if ever at all, complete > serialization can be found in the syslog sink, perhaps) as briefly > touched on earlier in this thread[1]. > > [1] https://lists.clusterlabs.org/pipermail/users/2019-April/025709.html > > -- > Jan (Poki) _______________________________________________ Manage your subscription: https://lists.clusterlabs.org/mailman/listinfo/users ClusterLabs home: https://www.clusterlabs.org/
