Opened 12 years ago

Closed 10 years ago

#2295 defect closed fixed (fixed)

distrib listenUNIX should use the usePID=1 lock system

Reported by: itamarst Owned by: Jean-Paul Calderone
Priority: normal Milestone:
Component: web Keywords:
Cc: ralphm Branch: branches/distrib-wantpid-2295-2
branch-diff, diff-cov, branch-cov, buildbot
Author: exarkun

Description

Without the lock system, a crashed distrib web server can't restart automatically, cause the unix socket is left lying around.

Change History (10)

comment:1 Changed 10 years ago by Jean-Paul Calderone

Keywords: review added
Owner: Jean-Paul Calderone deleted

Instead of making distrib pass wantPID=True unconditionally, I made --personal start a server listening on the value passed to --port.

I also extended strports UNIX support to accept a wantPID=1 parameter.

The default behavior is the same, but if a user wants pidfile-based locking on their distrib servers, they can get it.

Build results: http://buildbot.twistedmatrix.com/boxes-supported?branch=/branches/distrib-wantpid-2295

comment:2 Changed 10 years ago by radix

wantPID is a bad name. It's too bad that it's already used in listenUNIX, but if we're going to expose it to strports we should use a better name.

writePIDFile sounds like a better option.

I also wonder why we don't just default to writing PID files.

comment:3 Changed 10 years ago by therve

Keywords: review removed
Owner: set to Jean-Paul Calderone

Cool, please merge. Changing the name is an unrelated issue, open another ticket if you want.

comment:4 Changed 10 years ago by radix

I don't have much of an excuse, since my comment above was not explicitly a review, but I'm curious to know whether the points I raised were dealt with in the branch.

comment:5 Changed 10 years ago by Jean-Paul Calderone

They weren't at all. I'll think about them before merging, even though therve said I could, and maybe address them and re-submit for review.

comment:6 Changed 10 years ago by Jean-Paul Calderone

Branch: branches/distrib-wantpid-2295
Keywords: review added

I renamed the parameter in strports (not elsewhere) and change its default to true.

comment:7 Changed 10 years ago by Jean-Paul Calderone

Owner: Jean-Paul Calderone deleted

comment:8 Changed 10 years ago by ralphm

Cc: ralphm added
Keywords: review removed
Owner: set to Jean-Paul Calderone

Looks good to me. Please merge.

comment:9 Changed 10 years ago by Jean-Paul Calderone

author: exarkun
Branch: branches/distrib-wantpid-2295branches/distrib-wantpid-2295-2

(In [24989]) Branching to 'distrib-wantpid-2295-2'

comment:10 Changed 10 years ago by Jean-Paul Calderone

Resolution: fixed
Status: newclosed

(In [24991]) Merge distrib-wantpid-2295-2

Author: exarkun Reviewer: ralphm Fixes: #2295

Add an optional parameter to the AF_FILE style of strport description, lockfile. By default, a "unix:" strport will attempt to acquire a lock associate with the socket specified. If lockfile=0 is given, this behavior will be disabled.

twisted.web.distrib is also changed to allow a strports description for the port it listens on, allowing a lock file to be used or not with the port it listens on.

Note: See TracTickets for help on using tickets.