NewIssueWorker is failing when we log about skipping notifications
I noticed this in Sentry: https://sentry.gitlab.net/gitlab/gitlabcom/issues/2523569/?query=is%3Aunresolved%20SystemStackError
Relevant part of stacktrace:
SystemStackError: stack level too deep
from active_record/dynamic_matchers.rb:33:in `find'
...
from active_support/core_ext/object/json.rb:57:in `as_json'
from active_support/core_ext/object/json.rb:172:in `block in as_json'
from active_support/core_ext/object/json.rb:172:in `each'
from active_support/core_ext/object/json.rb:172:in `map'
from active_support/core_ext/object/json.rb:172:in `as_json'
from active_support/core_ext/object/json.rb:57:in `as_json'
from active_support/core_ext/object/json.rb:172:in `block in as_json'
from active_support/core_ext/object/json.rb:172:in `each'
from active_support/core_ext/object/json.rb:172:in `map'
from active_support/core_ext/object/json.rb:172:in `as_json'
from active_support/core_ext/object/json.rb:57:in `as_json'
from active_support/core_ext/object/json.rb:172:in `block in as_json'
from active_support/core_ext/object/json.rb:172:in `each'
from active_support/core_ext/object/json.rb:172:in `map'
from active_support/core_ext/object/json.rb:172:in `as_json'
from gitlab/json.rb:110:in `dump'
from gitlab/json.rb:110:in `adapter_dump'
from gitlab/json.rb:42:in `dump'
from gitlab/json_logger.rb:22:in `format_message'
from logger.rb:475:in `add'
from logger.rb:537:in `warn'
from gitlab/multi_destination_logger.rb:18:in `block in warn'
from gitlab/multi_destination_logger.rb:18:in `each'
from gitlab/multi_destination_logger.rb:18:in `warn'
from notification_service.rb:859:in `warn_skipping_notifications'
from notification_service.rb:707:in `new_resource_email'
from notification_service.rb:98:in `new_issue'
from new_issue_worker.rb:16:in `perform'
Edited by Heinrich Lee Yu