Closed Bug 1272183 Opened 9 years ago Closed 9 years ago

Busy loop in autophonetreeherder

Categories

(Testing Graveyard :: Autophone, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: gbrown, Assigned: gbrown)

References

Details

Attachments

(1 file)

The treeherder submission server loops, sleeping following failed submissions. But following successful submissions, there is no sleep, even if there are no jobs available, resulting in a tight loop, and high cpu use. This is a regression from bug 1267531.
Currently serve_forever() calls jobs.get_next_treeherder_job() in a tight loop unless post_request() fails. Prior to bug 1267531, serve_forever() would sleep for retry_wait seconds between calls to jobs.get_next_treeherder_job(). In this patch, I'm sleeping for just 1 second between job retrieval attempts -- I think it's enough of a rest, keeps job submission snappy, and decouples avoiding-a-busy-loop from wait-after-failure (retry_wait). This significantly reduces autophone cpu usage for me.
Attachment #8751798 - Flags: review?(bob)
Comment on attachment 8751798 [details] [diff] [review] sleep between calls to jobs.get_next_treeherder_job() Review of attachment 8751798 [details] [diff] [review]: ----------------------------------------------------------------- r+. great! I'd noticed the cpu issue but hadn't looked into it yet. Thanks for fixing it already!
Attachment #8751798 - Flags: review?(bob) → review+
deployed 2016-05-12 14:00:00
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Product: Testing → Testing Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: