#1916 frontend: log pending build records only when debugging
Merged 2 months ago by praiskup. Opened 2 months ago by frostyx.
copr/ frostyx/copr pending-jobs-logging  into  main

@@ -313,7 +313,8 @@ 

           if build_ready(task.build)]

      )

  

-     log.info('Selected build records: {}'.format(build_records))

+     log.info('Number of selected build records: %s', len(build_records))

+     log.debug('Selected build records: %s', build_records)

      return flask.jsonify(build_records)

  

  

Today we almost ran out of disk space on copr-frontend because we are
mass-rebuilding rubygems, and periodically logging all pending builds
resulted in 20G copr-frontend.log.

I think we can simply log the number of pending builds instead of
their whole records. That might be useful for debugging though, so I
am keeping the original command but switching it from log.info to
log.debug.

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci

rebased onto 0c96ef6

2 months ago

Build succeeded.

In general I agree with this change, however shouldn't it be %d instead of %s? I mean with that len(build_records)

shouldn't it be %d instead of %s?

I think %s is OK as well, as long as we don't do any decimal point dance ... python will silently retype number to string (even though it wouldn't vice-versa).

+1

Pull-Request has been merged by praiskup

2 months ago

In general I agree with this change, however shouldn't it be %d instead of %s? I mean with that

True, sorry, I didn't realize this. Anyway, as @praiskup says, it will implicitly retype, and the PR is merged, so I would just leave it be now.