Skip to content

Commit 540489e

Browse files
committed
syz-agent: extend logging
1 parent eac13be commit 540489e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

syz-agent/agent.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,13 +183,16 @@ func (s *Server) poll(ctx context.Context) (bool, error) {
183183
Name: flow.Name,
184184
})
185185
}
186+
log.Logf(0, "querying jobs for %v", req.Workflows)
186187
resp, err := s.dash.AIJobPoll(req)
187188
if err != nil {
188189
return false, err
189190
}
190191
if resp.ID == "" {
191192
return false, nil
192193
}
194+
log.Logf(0, "starting job %v %v", resp.Workflow, resp.ID)
195+
defer log.Logf(0, "finished job %v %v", resp.Workflow, resp.ID)
193196
doneReq := &dashapi.AIJobDoneReq{
194197
ID: resp.ID,
195198
}
@@ -208,10 +211,14 @@ func (s *Server) poll(ctx context.Context) (bool, error) {
208211
// the dashboard at all. For the dashboard it will look like
209212
// the server has crashed while executing the job, and it should
210213
// eventually retry it on common grounds.
211-
s.overQuotaModels[model] = time.Now()
214+
now := time.Now()
215+
s.overQuotaModels[model] = now
216+
log.Logf(0, "model %v is over daily quota until %v",
217+
model, aflow.QuotaResetTime(now))
212218
return true, nil
213219
}
214220
}
221+
log.Logf(0, "done executing job %v %v", resp.Workflow, resp.ID)
215222
if err := s.dash.AIJobDone(doneReq); err != nil {
216223
return false, err
217224
}
@@ -261,6 +268,7 @@ func (s *Server) modelOverQuota(flow *aflow.Flow) bool {
261268
func (s *Server) resetModelQuota() {
262269
for model, when := range s.overQuotaModels {
263270
if aflow.QuotaResetTime(when).After(time.Now()) {
271+
log.Logf(0, "model %v daily quota is replenished", model)
264272
delete(s.overQuotaModels, model)
265273
}
266274
}

0 commit comments

Comments
 (0)