Closed
Bug 557049
Opened 15 years ago
Closed 15 years ago
[amo] monitor zamboni wsgi in prod
Categories
(Infrastructure & Operations Graveyard :: WebOps: Other, task)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: jbalogh, Assigned: oremj)
References
()
Details
(Whiteboard: Waiting until /services/loaded is in production.)
We updated to 5.8.3 on Thursday, but I left out touching the .wsgi file from the upgrade script. It appears that the code got updated but apache is still running the old code. We're getting tracebacks that shouldn't be possible anymore, and the line numbers are all wrong.
`touch /data/amo_python/www/services.prod/zamboni/wsgi/zamboni.wsgi` will force mod_wsgi to reload.
`rm **/*.pyc` for extra paranoia.
Comment 1•15 years ago
|
||
Jeff wrote a short script to check if wsgi is older than the git update:
> from datetime import datetime
> import os
> import subprocess
> import sys
>
> GIT = "git log -1 --date=local | grep Date: | sed 's/Date: *//'"
>
> wsgi = datetime.fromtimestamp(os.stat('wsgi/zamboni.wsgi').st_mtime)
> git_ = subprocess.Popen(GIT, stdout=subprocess.PIPE, shell=True).communicate()[0]
> git = datetime.strptime(git_.strip(), '%a %b %d %H:%M:%S %Y')
>
> if wsgi > git:
> print "ok"
> sys.exit(0)
> else:
> print "wsgi is too old"
> sys.exit(2)
We could add that to nagios to make sure this doesn't happen again.
Assignee | ||
Updated•15 years ago
|
Assignee: thardcastle → jeremy.orem+bugs
Assignee | ||
Comment 2•15 years ago
|
||
Apache was restarted after the updated. Even if it isn't updated I have MaxRequestsPerChild set at 100, so the processes should refresh fairly quickly.
Looks like no .pyc files.
/data/bin/issue-multi-command.py -c 1 amo 'find /data/amo_python/www/prod | grep pyc'
===pm-app-amo02===
===pm-app-amo03===
===pm-app-amo04===
===pm-app-amo05===
===pm-app-amo07===
===pm-app-amo08===
===pm-app-amo10===
===pm-app-amo11===
===pm-app-amo12===
===pm-app-amo13===
===pm-app-amo14===
===pm-app-amo15===
===pm-app-amo16===
===pm-app-amo17===
===pm-app-amo18===
===pm-app-amo19===
===pm-app-amo20===
===pm-app-amo21===
===pm-app-amo24===
===pm-app-amo25===
===pm-app-amo26===
Assignee | ||
Updated•15 years ago
|
Summary: [amo] touch zamboni.wsgi on prod → [amo] monitor zamboni wsgi in prod
Assignee | ||
Updated•15 years ago
|
Severity: major → normal
Reporter | ||
Comment 3•15 years ago
|
||
(In reply to comment #2)
> Apache was restarted after the updated. Even if it isn't updated I have
> MaxRequestsPerChild set at 100, so the processes should refresh fairly quickly.
Hmm, it seemed like something was not right. I haven't seen any timeouts since April 3rd, so we'll see how it goes.
With the MaxRequests, would that re-read the source or make a new fork from the parent mod_wsgi?
> Looks like no .pyc files.
That seems...unlikely. I don't know why Python wouldn't be creating .pyc files.
Oh, maybe it doesn't have write perms on those files?
> /data/bin/issue-multi-command.py -c 1 amo 'find /data/amo_python/www/prod |
> grep pyc'
Is the source for that available somewhere? I'm just curious.
Assignee | ||
Comment 4•15 years ago
|
||
(In reply to comment #3)
> (In reply to comment #2)
> > Apache was restarted after the updated. Even if it isn't updated I have
> > MaxRequestsPerChild set at 100, so the processes should refresh fairly quickly.
>
> Hmm, it seemed like something was not right. I haven't seen any timeouts since
> April 3rd, so we'll see how it goes.
>
> With the MaxRequests, would that re-read the source or make a new fork from the
> parent mod_wsgi?
Now that I think about it, this might not reload mod_wsgi at all since it is in daemon mode.
>
> > Looks like no .pyc files.
>
> That seems...unlikely. I don't know why Python wouldn't be creating .pyc
> files.
>
> Oh, maybe it doesn't have write perms on those files?
All the directories are owned by root, so it doesn't have write perms.
>
> > /data/bin/issue-multi-command.py -c 1 amo 'find /data/amo_python/www/prod |
> > grep pyc'
>
> Is the source for that available somewhere? I'm just curious.
http://gist.github.com/356796
Assignee | ||
Comment 5•15 years ago
|
||
I'm not sure this script will work. We don't sync out zamboni's .git. Any other ideas?
(In reply to comment #1)
> Jeff wrote a short script to check if wsgi is older than the git update:
>
> > from datetime import datetime
> > import os
> > import subprocess
> > import sys
> >
> > GIT = "git log -1 --date=local | grep Date: | sed 's/Date: *//'"
> >
> > wsgi = datetime.fromtimestamp(os.stat('wsgi/zamboni.wsgi').st_mtime)
> > git_ = subprocess.Popen(GIT, stdout=subprocess.PIPE, shell=True).communicate()[0]
> > git = datetime.strptime(git_.strip(), '%a %b %d %H:%M:%S %Y')
> >
> > if wsgi > git:
> > print "ok"
> > sys.exit(0)
> > else:
> > print "wsgi is too old"
> > sys.exit(2)
>
> We could add that to nagios to make sure this doesn't happen again.
Reporter | ||
Comment 6•15 years ago
|
||
We could check that zamboni.wsgi is newer than any other .py or .html files in the tree.
Assignee | ||
Comment 7•15 years ago
|
||
For production we typically restart apache instead of touching zamboni.wsgi. Should we start touching it instead or can you think of another way to do this?
Comment 8•15 years ago
|
||
We need to restart apache to pick up .mo changes at least until PHP goes away. I don't know how wsgi+.mo works, does it still need restarting?
Assignee | ||
Comment 9•15 years ago
|
||
14:05 < jbalogh> oremj: I just pushed /services/loaded
Assignee | ||
Updated•15 years ago
|
Whiteboard: Waiting until /services/loaded is in production.
Reporter | ||
Comment 10•15 years ago
|
||
This is expected to go to prod on 6/1.
Reporter | ||
Comment 11•15 years ago
|
||
Assignee | ||
Comment 12•15 years ago
|
||
Do we want to do something like this?
http://gist.github.com/441263
Assignee | ||
Comment 13•15 years ago
|
||
Final monitor: http://gist.github.com/441263
Nagios is monitoring it now.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Comment 14•15 years ago
|
||
Can you add a comment to the top about what it does and add it to http://github.com/jbalogh/zamboni/tree/master/scripts/ ? Thanks.
Assignee | ||
Comment 15•15 years ago
|
||
Updated•11 years ago
|
Component: Server Operations: Web Operations → WebOps: Other
Product: mozilla.org → Infrastructure & Operations
Updated•6 years ago
|
Product: Infrastructure & Operations → Infrastructure & Operations Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•