Closed Bug 719261 Opened 12 years ago Closed 12 years ago

Add more logging to AggregatingScheduler

Categories

(Release Engineering :: General, defect, P2)

x86_64
Linux
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: rail, Assigned: rail)

Details

Attachments

(1 file, 2 obsolete files)

It would be great to print some information about scheduled builders, initialization, etc.
Attached patch moar logging (obsolete) — Splinter Review
Attachment #589742 - Flags: feedback?(catlee)
Priority: -- → P2
Attached patch moar logging (obsolete) — Splinter Review
* print schedulerid to simplify debugging
* use self.working flag for transactions! :D Hopefully fixes bug 719260
* reset the state to its initial state after creating a buildset
* worked as expected in staging
Attachment #589742 - Attachment is obsolete: true
Attachment #589742 - Flags: feedback?(catlee)
Attachment #589969 - Flags: review?(catlee)
Comment on attachment 589969 [details] [diff] [review]
moar logging

Review of attachment 589969 [details] [diff] [review]:
-----------------------------------------------------------------

::: scheduler.py
@@ +383,5 @@
>          for b in self.upstreamBuilders:
>              if b not in state['remainingBuilders']:
>                  state['remainingBuilders'].append(b)
> +        log.msg('%s <id=%s>: reloaded' % (self.__class__.__name__,
> +                                          self.schedulerid))

I think you should use id(self) here instead of self.schedulerid. Or perhaps log both? The thing we want to know is if two instances of the scheduler are running at the same time. The schedulerid's should be the same, because the schedulers will have the same name.

@@ +404,5 @@
>          self.set_state(t, state)
>  
>      def run(self):
>          d = self.parent.db.runInteraction(self._run)
>          return d

would it make sense to move the 'if self.working' logic into the run() method instead of _run()?

Also, I think adding a callback to d to reset self.working to False is better than setting it at the end of _run(), since exceptions may be raised inside _run() that would prevent self.working to be reset to False.
Attachment #589969 - Flags: review?(catlee) → review-
(In reply to Chris AtLee [:catlee] from comment #3)
> I think you should use id(self) here instead of self.schedulerid. Or perhaps
> log both? The thing we want to know is if two instances of the scheduler are
> running at the same time. The schedulerid's should be the same, because the
> schedulers will have the same name.

OK.
 
> @@ +404,5 @@
> >          self.set_state(t, state)
> >  
> >      def run(self):
> >          d = self.parent.db.runInteraction(self._run)
> >          return d
> 
> would it make sense to move the 'if self.working' logic into the run()
> method instead of _run()?

I thought about that, but run() just adds deferred to to the pool and actual execution happens in _run().
 
> Also, I think adding a callback to d to reset self.working to False is
> better than setting it at the end of _run(), since exceptions may be raised
> inside _run() that would prevent self.working to be reset to False.

Good point. I should reset the state in any case.
Attached patch moar logging 2Splinter Review
* use id(self)
* reset self.working in any case

intediff: https://gist.github.com/1647790
Attachment #589969 - Attachment is obsolete: true
Attachment #590191 - Flags: review?(catlee)
Attachment #590191 - Flags: review?(catlee) → review+
Merged to production.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Product: mozilla.org → Release Engineering
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: