{"action":"created","issue":{"url":"https://api.github.com/repos/ManageIQ/manageiq/issues/3227","repository_url":"https://api.github.com/repos/ManageIQ/manageiq","labels_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/3227/labels{/name}","comments_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/3227/comments","events_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/3227/events","html_url":"https://github.com/ManageIQ/manageiq/pull/3227","id":89778387,"number":3227,"title":"Block duplicated events","user":{"login":"bzwei","id":7047579,"avatar_url":"https://avatars.githubusercontent.com/u/7047579?v=3","gravatar_id":"","url":"https://api.github.com/users/bzwei","html_url":"https://github.com/bzwei","followers_url":"https://api.github.com/users/bzwei/followers","following_url":"https://api.github.com/users/bzwei/following{/other_user}","gists_url":"https://api.github.com/users/bzwei/gists{/gist_id}","starred_url":"https://api.github.com/users/bzwei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bzwei/subscriptions","organizations_url":"https://api.github.com/users/bzwei/orgs","repos_url":"https://api.github.com/users/bzwei/repos","events_url":"https://api.github.com/users/bzwei/events{/privacy}","received_events_url":"https://api.github.com/users/bzwei/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ManageIQ/manageiq/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/ManageIQ/manageiq/labels/events","name":"events","color":"5319e7"},{"url":"https://api.github.com/repos/ManageIQ/manageiq/labels/stale%20pr","name":"stale pr","color":"b60205"}],"state":"open","locked":false,"assignee":{"login":"chriskacerguis","id":2414647,"avatar_url":"https://avatars.githubusercontent.com/u/2414647?v=3","gravatar_id":"","url":"https://api.github.com/users/chriskacerguis","html_url":"https://github.com/chriskacerguis","followers_url":"https://api.github.com/users/chriskacerguis/followers","following_url":"https://api.github.com/users/chriskacerguis/following{/other_user}","gists_url":"https://api.github.com/users/chriskacerguis/gists{/gist_id}","starred_url":"https://api.github.com/users/chriskacerguis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chriskacerguis/subscriptions","organizations_url":"https://api.github.com/users/chriskacerguis/orgs","repos_url":"https://api.github.com/users/chriskacerguis/repos","events_url":"https://api.github.com/users/chriskacerguis/events{/privacy}","received_events_url":"https://api.github.com/users/chriskacerguis/received_events","type":"User","site_admin":false},"milestone":null,"comments":16,"created_at":"2015-06-20T14:50:25Z","updated_at":"2016-06-21T18:11:56Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/3227","html_url":"https://github.com/ManageIQ/manageiq/pull/3227","diff_url":"https://github.com/ManageIQ/manageiq/pull/3227.diff","patch_url":"https://github.com/ManageIQ/manageiq/pull/3227.patch"},"body":"Mix `DuplicateBlocker` in `ManageIQ::Providers::BaseManager::EventCatcher::Runner` to block duplicated events when there are too many duplicates in a short time.\r\n\r\n1. Split  `process_event(event)` into `filtered?(event)` and `queue_event(event)`\r\n2. Monitor `queue_event(event)`. Do not place the event to the queue if the event is considered a duplicate that exceeds the count threshold.\r\n3. Every provider's `EventCatcher::Runner` needs to implement `event_dedup_key(event)`. It should generate an object that helps to distinguish whether an event is a duplicate. For example in the VMware implementation, timestamps and sequence numbers are removed while other event contents are preserved.\r\n4. Every provider's `EventCatcher::Runner` needs to implement `event_dedup_descriptor(event)`. It should return a string to describe an event, not only the event type, but other details. The string will be logged to tell the user what event has been blocked due to too many duplicates.\r\n5. Parameters such as time window to monitor and duplicate count threshold are initialized in `event_handling.tmpl.yml` under `workers/worker_base/event_catcher/defaults`. These parameters are valid for all providers. However each provider can overwrite each particular parameter. By default the blocking feature is disabled. User needs to turn it on.\r\n6. With this PR `event_dedup_key(event)` and `event_dedup_descriptor(event)` are implemented only for VMware. Additional work should be done to other providers.\r\n7. Added spec tests."},"comment":{"url":"https://api.github.com/repos/ManageIQ/manageiq/issues/comments/227524569","html_url":"https://github.com/ManageIQ/manageiq/pull/3227#issuecomment-227524569","issue_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/3227","id":227524569,"user":{"login":"miq-bot","id":7806257,"avatar_url":"https://avatars.githubusercontent.com/u/7806257?v=3","gravatar_id":"","url":"https://api.github.com/users/miq-bot","html_url":"https://github.com/miq-bot","followers_url":"https://api.github.com/users/miq-bot/followers","following_url":"https://api.github.com/users/miq-bot/following{/other_user}","gists_url":"https://api.github.com/users/miq-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/miq-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miq-bot/subscriptions","organizations_url":"https://api.github.com/users/miq-bot/orgs","repos_url":"https://api.github.com/users/miq-bot/repos","events_url":"https://api.github.com/users/miq-bot/events{/privacy}","received_events_url":"https://api.github.com/users/miq-bot/received_events","type":"User","site_admin":false},"created_at":"2016-06-21T18:11:56Z","updated_at":"2016-06-21T18:11:56Z","body":"<pr_mergeability_checker />This pull request is not mergeable.  Please rebase and repush."}}
{"actor":{"display_login":"miq-bot"}}