プロジェクト

全般

プロフィール

Vote #66809

完了

reminder mails are not sent when delivery_method is :async_smtp

Admin Redmine さんが約4年前に追加. 約4年前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Email notifications_9
対象バージョン:
開始日:
2010/03/12
期日:
進捗率:

0%

予定工数:
category_id:
9
version_id:
40
issue_org_id:
5058
author_id:
332
assigned_to_id:
0
comments:
13
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
17
ステータス-->[Closed]

説明

Reminder mails (@rake redmine:send_reminders@) are not sent when I set @delivery_method@ in config/email.yml to @:async_smtp@.

version: Redmine 0.9.3.stable.3561


journals

Confirmed. The reason is that the process doesn't wait for the thread to finish. Adding a simple sleep works but it's not an elegant fix:

<pre>
Index: app/models/mailer.rb
===================================================================
--- app/models/mailer.rb (revision 3560)
+++ app/models/mailer.rb (working copy)
@@ -323,6 +323,7 @@
issues_by_assignee.each do |assignee, issues|
deliver_reminder(assignee, issues, days) unless assignee.nil?
end
+ sleep(10)
end

private
</pre>

Maybe we'd better disable asynchronous sending when sending reminders.
--------------------------------------------------------------------------------
Thanks for investigation.
How about this fix? Waiting for all threads to finish.

<pre>
Index: app/models/mailer.rb
===================================================================
--- app/models/mailer.rb (revision 3561)
+++ app/models/mailer.rb (working copy)
@@ -309,6 +309,7 @@
issues_by_assignee.each do |assignee, issues|
deliver_reminder(assignee, issues, days) unless assignee.nil?
end
+ Thread.list.each {|t| t.join(10) unless t == Thread.current}
end

private
</pre>
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Go MAEDA wrote:
> Thanks for investigation.
> How about this fix? Waiting for all threads to finish.
>
> [...]

Note 19 of #4228 states that it does not work :(
--------------------------------------------------------------------------------
Would be nice if someone could test this change to @lib/tasks/email.rake@ as proposed in #4228 :

<pre><code class="ruby">
task :receive_imap => :environment do
Thread.abort_on_exception = true
...
(existing code)
...
threads.each {|t| t.join }
end
</pre></code>

--------------------------------------------------------------------------------
Resolved by switching smtp @delivery_method@ setting from @async_smtp@ to @smtp@, which kind of a feature loss.

Would be great if someone could post a feedback of the change proposed in note-21.
--------------------------------------------------------------------------------
Closed accidentally by closing duplicate.
--------------------------------------------------------------------------------
Etienne, it didnt work for me.
--------------------------------------------------------------------------------

I'm quite sure that this same issue has been causing emails to (sometimes) not be generated in response to email-stimulus (the process-incoming-emails rake task). Drop rate <30%.

--------------------------------------------------------------------------------
I just stumbled upon this issue and finally found out why I never got the reminder emails feature working...

Etienne Massip wrote:
> Would be nice if someone could test this change to @lib/tasks/email.rake@ as proposed in #4228 :
>
> [...]</code>

Just tested it, but the same as Serge ST, it isn't working.

Note: I've added a reference to this issue on [[RedmineReminderEmails]] and [[EmailConfiguration]].
--------------------------------------------------------------------------------
This should be fixed in r9367.
--------------------------------------------------------------------------------
Merged in r9375.
--------------------------------------------------------------------------------


related_issues

relates,Closed,5293,too slow ticket update in new version
relates,Closed,613,Asynchronous email delivery
duplicates,Closed,4228,no notification on issue creation by mail with redmine:email:receive_imap

Admin Redmine さんが約4年前に更新

  • カテゴリEmail notifications_9 にセット
  • 対象バージョン1.4.0_40 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0