Ævar Arnfjörð Bjarmason <avarab@xxxxxxxxx> writes: > unique (AFAICT "actually unique" in practice) in the parallel in-flight > jh/trace2-sid-fix > (https://public-inbox.org/git/4352952677a11776a18ec9b6862cf358307cfafd.1553879063.git.gitgitgadget@xxxxxxxxx/) > > I think it's fine to merge js/trace2-to-directory down as it is, but do > you/Josh think that retry logic needs to stay with that sort of SID? I do not speak for Josh, but I think the only two logical choices are to open with (O_CREAT|O_EXCL) and (1) fallback with .%d suffix, making it clear that we are not willing to lose log files even when SID generation is botched; or (2) die/BUG when it fails, making it clear that we do rely on the guanateed uniqueness of SID. A distant third may be to warn when open with O_CREAT|O_EXCL fails, but I am not sure what its value would be to do so---especially if we trust in the "actually unique in practice". Between (1) and (2), I have a slight preference to (1) over (2), as that is much easier to explain. Those who want to have a "fixed width" thing could just ignore the ones with suffix---as long as the "actually unique in practice" claim holds, doing so will not lose any non-negligible amount of information anyway.