プロジェクト

全般

プロフィール

Vote #81775

未完了

Mailer.with_synched_deliveries is not thread-safe

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

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

0%

予定工数:
category_id:
9
version_id:
0
issue_org_id:
36395
author_id:
2784
assigned_to_id:
0
comments:
1
status_id:
1
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
170
ステータス-->[New]

説明

The @Mailer.with_synched_deliveries@ method sets global state (that is: the queue adapter used to queue new jobs) for the duration of the block.

This affects the global state of all concurrent threads, rather than just the current thread. If a multi-threaded application server or queueing system is in use (such as puma or resque), this can result in unintended consequences such as jobs not scheduled to the "normal" queuing system or errors being raised (if a job is supposed to be scheduled for a fixed later time which is not supported by the @InlineAdapter@).

As such, the method should be updated to only have a thread-local effect. This may possibly be achieved by introducing a fixed queue adapter wrapper which forwards requests to enqueue jobs to either the "normal" async adapter or the inline adapter based on a thread-local variable set by @Mailer.with_synched_deliveries@.


journals

--------------------------------------------------------------------------------


related_issues

relates,Closed,36393,Mailer.with_synched_deliveries doesn't correctly detect other async Queue adapters

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

  • カテゴリEmail notifications_9 にセット

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

いいね!0
いいね!0