[Checkins] [zopefoundation/zdaemon] 353bc3: Fix delayed deadlock when transcript thread dies (...

GitHub noreply at github.com
Wed Apr 15 19:35:10 CEST 2015


  Branch: refs/heads/master
  Home:   https://github.com/zopefoundation/zdaemon
  Commit: 353bc3404c7cebe9fc6287f7ec8367681b1226df
      https://github.com/zopefoundation/zdaemon/commit/353bc3404c7cebe9fc6287f7ec8367681b1226df
  Author: Marius Gedminas <marius at gedmin.as>
  Date:   2015-04-15 (Wed, 15 Apr 2015)

  Changed paths:
    M CHANGES.rst
    M src/zdaemon/zdrun.py

  Log Message:
  -----------
  Fix delayed deadlock when transcript thread dies (#1)

Test plan:

- mount a small tmpfs with 'sudo mount -t tmpfs none /mnt -o size=4096'

- create a zdaemon config file
    <runner>
      program yes
      transcript /mnt/transcript.log
    </runner>

- run zdaemon -C conf start

- wait a few milliseconds for /mnt to fill up

- pgrep yes

If the 'yes' program is still running, we have a deadlock (strace and
you'll find it blocked on write()).  This is the situation before this
patch, as described in bug #1.

If the 'yes' program is dead, the deadlock is fixed.

- run zdaemon -C conf status

The daemon manager should be stopped (it's not functional without the
dead transcript thread).

Automating this test is left as an exercise for the reader.  :(


  Commit: 96cc4a394e1122fb0ec340bb8fcd09c84ba4539a
      https://github.com/zopefoundation/zdaemon/commit/96cc4a394e1122fb0ec340bb8fcd09c84ba4539a
  Author: Marius Gedminas <marius at gedmin.as>
  Date:   2015-04-15 (Wed, 15 Apr 2015)

  Changed paths:
    M src/zdaemon/zdctl.py

  Log Message:
  -----------
  reopen_transcript even if the process is not running

Even if I happen to logrotate the file while the daemon manager is
waiting before respawning the program, that still means I want the
newly-spawned program to log into the new file, not the rotated one.


  Commit: 0b95470d0c2b4f47fd8748645728904c826421e2
      https://github.com/zopefoundation/zdaemon/commit/0b95470d0c2b4f47fd8748645728904c826421e2
  Author: Marius Gedminas <marius at gedmin.as>
  Date:   2015-04-15 (Wed, 15 Apr 2015)

  Changed paths:
    M CHANGES.rst
    M src/zdaemon/tests/tests.py
    M src/zdaemon/tests/testzdctl.py
    M src/zdaemon/zdctl.py

  Log Message:
  -----------
  Make logreopen also reopen the transcript log (#9)


  Commit: 560abe1790657c7214b5d724f41a9c35e5236ab3
      https://github.com/zopefoundation/zdaemon/commit/560abe1790657c7214b5d724f41a9c35e5236ab3
  Author: Marius Gedminas <marius at gedmin.as>
  Date:   2015-04-15 (Wed, 15 Apr 2015)

  Changed paths:
    M CHANGES.rst
    M src/zdaemon/tests/tests.py
    M src/zdaemon/zdrun.py

  Log Message:
  -----------
  Reopen event log on 'logreopen' or 'reopen_transcript' (#8)


Compare: https://github.com/zopefoundation/zdaemon/compare/ba102a48bb20...560abe179065


More information about the checkins mailing list