Digest 邮件发送中的无限循环

大家好。

我们的 Discourse 服务器陷入了无限循环,不停地发送邮件。以下是 shared/standalone/log/rails/production.log 的输出:

Delivered mail 7db8eecd-c36a-419c-ae34-0561b08bae25@community.xx.cc (1322.2ms)
  Rendered user_notifications/digest.text.erb (Duration: 50.1ms | Allocations: 12577)
  Rendering user_notifications/digest.html.erb within layouts/email_template
  Rendered user_notifications/digest.html.erb within layouts/email_template (Duration: 139.5ms | Allocations: 26910)
  Rendering user_notifications/digest.text.erb
  Rendered user_notifications/digest.text.erb (Duration: 71.7ms | Allocations: 13505)
Delivered mail 5bbf2e54-96a8-437d-a032-69f98a00f22a@community.xx.cc (1485.2ms)
  Rendering user_notifications/digest.html.erb within layouts/email_template
  Rendered user_notifications/digest.html.erb within layouts/email_template (Duration: 70.9ms | Allocations: 20613)
  Rendering user_notifications/digest.text.erb
  Rendered user_notifications/digest.text.erb (Duration: 38.2ms | Allocations: 11390)

这个问题是突然发生的(可能是在摘要定时任务启动时:

现在有一个核心完全忙于发送摘要邮件。

  • 重新构建应用没有帮助;

  • 更新到最新版本后也没有变化;

  • 开启“禁用所有用户的摘要邮件”并重新构建应用后仍无变化;

    #### 已安装
    
    ### 2.4.0.beta5
    

我还能做什么?我该如何停止这种情况?
提前感谢。

1 个赞

I could be wrong, but I think that what happened is that the summary emails got queued and now it’s delivering them. It’s going to keep going until it delivers them.

If I’m right, You can disable emails then find the table that has them and delete them. But it’s just going to happen again the next time that summary emails go out.

1 个赞

Yes, but this happens for 3 days already. All other mails (register, for example are not delivered anymore. Community works, but all emailing - not).
I found very similar issue - Extreme memory usage due to bad mail credentials. So look like this is some kind of tricky bug.

The only way I found in order to stop this - I removed the auth token in my SMTP provider. Discourse start showing hundreds of errors and only after that load decreased. I restored the token and now all seems ok.

1 个赞

Did you have bad email credentials?

@codinghorror I found the root cause of the issue. Our mail provider removed (for their own stupid reasons) verified host records for our account. The host records were used to provide from field in the email with our host. So after they did that - discourse went into endless loop. I think discourse flow has a bug as well for that case. Because it should report the error and stop load 1 core for 100%.

So account is correct. But mail provider returns an error on mail send “Wrong sending host” or something like that and this flow causes the issue.

2 个赞

I agree, this is a bad state to be in and we should handle it better.

1 个赞

Is everything back to normal now?

Yes. After I changed credentials for mail.

1 个赞