Closed
Bug 715780
Opened 14 years ago
Closed 14 years ago
fix locking on cron submitter
Categories
(Socorro :: Backend, task)
Socorro
Backend
Tracking
(Not tracked)
RESOLVED
FIXED
2.5.1
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
| Assignee | ||
Comment 1•14 years ago
|
||
New submit dumps script attached. rhelmer could you please review?
Attachment #601786 -
Flags: review?(rhelmer)
| Assignee | ||
Comment 2•14 years ago
|
||
Uploaded an old version, here is the latest.
Attachment #601786 -
Attachment is obsolete: true
Attachment #601786 -
Flags: review?(rhelmer)
Attachment #601792 -
Flags: review?(rhelmer)
| Reporter | ||
Comment 3•14 years ago
|
||
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)
| Reporter | ||
Comment 4•14 years ago
|
||
(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.
| Assignee | ||
Comment 5•14 years ago
|
||
(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.
| Assignee | ||
Comment 6•14 years ago
|
||
ping?
| Assignee | ||
Comment 7•14 years ago
|
||
updated to include if statement.
Attachment #601841 -
Attachment is obsolete: true
Attachment #601841 -
Flags: review?(jthomas)
| Assignee | ||
Updated•14 years ago
|
Attachment #605429 -
Flags: review?(rhelmer)
| Reporter | ||
Updated•14 years ago
|
Attachment #605429 -
Flags: review?(rhelmer) → review+
| Reporter | ||
Comment 8•14 years ago
|
||
Ready for inclusion to Socorro - https://github.com/mozilla/socorro/pull/437
Assignee: nobody → jthomas
Status: NEW → ASSIGNED
| Reporter | ||
Updated•14 years ago
|
Target Milestone: --- → 2.5.1
Comment 9•14 years ago
|
||
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 ...
| Reporter | ||
Comment 10•14 years ago
|
||
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
Updated•14 years ago
|
Whiteboard: [qa-]
You need to log in
before you can comment on or make changes to this bug.
Description
•