Closed Bug 715780 Opened 14 years ago Closed 14 years ago

fix locking on cron submitter

Categories

(Socorro :: Backend, task)

task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: rhelmer, Assigned: jason)

Details

(Whiteboard: [qa-])

Attachments

(1 file, 3 obsolete files)

We have a script on prod which submits crashes to staging in /data/bin/submit_dumps_to_staging.sh (also on stage, which submits to dev) This script creates a lock in /tmp which frequently gets stuck and needs to be removed manually. We should figure out why this is happening, and just switch it to use flock or something. Also it should use /var/lock not /tmp
Attached file submit dumps (obsolete) —
New submit dumps script attached. rhelmer could you please review?
Attachment #601786 - Flags: review?(rhelmer)
Attached file submit dumps (obsolete) —
Uploaded an old version, here is the latest.
Attachment #601786 - Attachment is obsolete: true
Attachment #601786 - Flags: review?(rhelmer)
Attachment #601792 - Flags: review?(rhelmer)
Attached file submit dumps v2 (obsolete) —
Hey this looks way better! The "if $(flock ...)" bit doesn't seem to work for me on stage - why not do it like this? I also cleaned up the psql line some, I don't think both of those (very complex) sed expressions are necessary just to remove the leading space, replaced it with a much smaller "tr -d"
Attachment #601792 - Attachment is obsolete: true
Attachment #601792 - Flags: review?(rhelmer)
Attachment #601841 - Flags: review?(jthomas)
(In reply to Robert Helmer [:rhelmer] from comment #3) > Created attachment 601841 [details] > > I also cleaned up the psql line some, I don't think both of those (very > complex) sed expressions are necessary just to remove the leading space, > replaced it with a much smaller "tr -d" BTW I realize it was like this in the original script, not your fault :) I also find the fact that this uses the jobs table really odd, but we can look at that later.
(In reply to Robert Helmer [:rhelmer] from comment #3) > Created attachment 601841 [details] > submit dumps v2 > > Hey this looks way better! The "if $(flock ...)" bit doesn't seem to work > for me on stage - why not do it like this? > I think we need to capture the exit code of flock -n, without it the any additional instances started continues to execute even if there is already an exclusive lock held by another instance. When tested with if statement, when the script is running and another instance is executed the second instance fails immediately. Without it any additional instances started will execute.
ping?
Attached file submit dumps v3
updated to include if statement.
Attachment #601841 - Attachment is obsolete: true
Attachment #601841 - Flags: review?(jthomas)
Attachment #605429 - Flags: review?(rhelmer)
Attachment #605429 - Flags: review?(rhelmer) → review+
Ready for inclusion to Socorro - https://github.com/mozilla/socorro/pull/437
Assignee: nobody → jthomas
Status: NEW → ASSIGNED
Target Milestone: --- → 2.5.1
Commit pushed to master at https://github.com/mozilla/socorro https://github.com/mozilla/socorro/commit/558f7f14b4a1d911a6a4713b276fcf7fa55b29b4 Merge pull request #437 from rhelmer/bug715780-cron-submitter bug 605429 - bring cron test crash submitter into socorro, with locking ...
This will go out next Wednesday, and will be installed to: /data/socorro/application/scripts/crons/cron_submitter.sh Logs will be written to /var/log/socorro/cron_submitter-${CRASH_REPORTS_HOST}.log
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: