[dovecot/core] 553dc9: stats: Work around shrinking system CPU usage

GitHub noreply at github.com
Fri May 6 18:30:11 UTC 2016


  Branch: refs/heads/master
  Home:   https://github.com/dovecot/core
  Commit: 553dc92ad045d748139cab65ad5e2da4c62f977a
      https://github.com/dovecot/core/commit/553dc92ad045d748139cab65ad5e2da4c62f977a
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2016-05-06 (Fri, 06 May 2016)

  Changed paths:
    M src/plugins/stats/mail-stats-fill.c

  Log Message:
  -----------
  stats: Work around shrinking system CPU usage

Happening at least in Debian's Linux kernel 4.3.0-1-amd64.

getrusage() may returns ru_stime = 4000 or 8000, but later it drops to 0.
We'll just work around this by switching to the previous working ru_stime.

This fixes errors like:
Error: stats: session stats shrank: sys_cpu 0.0 < 0.4000


  Commit: a16057fc5283ab54128edd73408c332217dffb5e
      https://github.com/dovecot/core/commit/a16057fc5283ab54128edd73408c332217dffb5e
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2016-05-06 (Fri, 06 May 2016)

  Changed paths:
    M src/plugins/stats/mail-stats-fill.c

  Log Message:
  -----------
  stats: Handle getrusage() errors better

I'm not aware of these errors actually happening anywhere, but its
error handling wouldn't have been correct if previous getrusage() calls
had succeeded. Now if it fails, log an error once and just keep on using
the last working rusage.


Compare: https://github.com/dovecot/core/compare/04d809e94541...a16057fc5283


More information about the dovecot-cvs mailing list