[tahoe-lafs-trac-stream] [Tahoe-LAFS] #3926: pid-file with creation-time

Tahoe-LAFS trac at tahoe-lafs.org
Thu Sep 15 21:58:33 UTC 2022


#3926: pid-file with creation-time
-----------------------------+-----------------------
     Reporter:  meejah       |      Owner:
         Type:  enhancement  |     Status:  new
     Priority:  normal       |  Milestone:  undecided
    Component:  unknown      |    Version:  n/a
   Resolution:               |   Keywords:
Launchpad Bug:               |
-----------------------------+-----------------------

Comment (by meejah):

 This seems a bit harder than expected.

 We can convince `twistd` infrastructure to not write a pidfile by setting
 `--pidfile` to `None`. However, we integrate via
 `twisted.internet.app.runApp` which is a function that doesn't return
 (because it calls `_exitWithSignal` and kills us).

 This means we can't use try-finally or a context manager. We can't use
 `atexit` (because it doesn't play nicely with signals). A facility like
 `reactor.addSystemEventTrigger("during", "shutdown", ...)` could work, but
 we don't have the reactor before calling `runApp` (and if we import it,
 `--reactor` option won't work).

--
Ticket URL: <https://tahoe-lafs.org/trac/tahoe-lafs/ticket/3926#comment:1>
Tahoe-LAFS <https://Tahoe-LAFS.org>
secure decentralized storage


More information about the tahoe-lafs-trac-stream mailing list