Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • P policyd
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 9
    • Issues 9
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • policydpolicyd
  • policyd
  • Merge requests
  • !30

Increase LastUpdate timestamp precission

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Alexander Markevich requested to merge hummermania/policyd:fix_time_prec into master Mar 07, 2017
  • Overview 2
  • Commits 1
  • Changes 2

Hello!

We use policyd on the intensivelly sending e-mail server. Amount of e-mails - 1M per day. We use only one rule - 100 e-mails from one recipient per time period.

In the exploitation process we see in log that quota counter maybe grow on by one. Also I see that 3-5 e-mail sending in one second - maximal precission on timestamp field, that quota counter dont increase. But sometimes he can revert to negative value.

This some buggy behaviour make many trouble for us.

I use this fix and test it in production some months. Inspecting log and monitoring graph show that we dramatically decrease situation when one recipient send e-mails above the quota - 200-300 and more. Because they had negative value on the quota counter or they dont grow.

Now I also testing additional fix with transaction begin and commit.

ex.

Now we have only some bugs in counter like this:

03:47:19 quota=6.24/100 (6.2%), last_update=1488847639.78458, pid=15310,
03:47:19 quota=7.24/100 (7.2%), last_update=1488847639.81541, pid=24140,
03:47:19 quota=8.24/100 (8.2%), last_update=1488847639.81785, pid=24165,    <--  equally timestamp
03:47:19 quota=8.24/100 (8.2%), last_update=1488847639.81785, pid=24171,    <--  from different pid
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: fix_time_prec