Forums: users (Thread #5100)

Resource temporarily unavailable (2004-05-05 07:16 by Anonymous #9373)

データベース形式を GDBM にした場合、同時に複数の bsfilter が動作すると GDBM::open で Errno::EAGAIN (Resource temporary unavailable) が出て終了してしまうようです。これが原因で、時々メールの処理に失敗する場合があります。

Errno::EAGAIN は GDBM の排他ロックによりロックされている状態を表しているので、手元では

--- bsfilter Fri Apr 30 17:27:39 2004
+++ bsfilter.modified Mon May 3 09:51:18 2004
@@ -661,7 +661,12 @@
end
end
def open_dbm(filename, mode)
- GDBM::open(filename, mode)
+ begin
+ GDBM::open(filename, mode)
+ rescue Errno::EAGAIN
+ sleep 1
+ retry
+ end
end
end

のように Errno::EAGAIN が出なくなるまで待つようにして対処しましたが、今のところ問題無く動作しているようです。

GDBM 以外については使っていないので分かりません。

Reply to #9373×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: Resource temporarily unavailable (2004-05-05 11:44 by nabeken #9376)

報告ありがとうございます。調査します。

使用しているOS
NFS使用の有無
複数のbsfilterが同一ホストで動作するのか、別ホストなのか
等々、出来れば環境を教えてください。
Reply to #9373

Reply to #9376×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: Resource temporarily unavailable (2004-05-05 16:55 by nabeken #9387)

revision 1.62で対処したつもりです。
よろしければ、CVSから取得して下さい。

排他制御はflockで独自に行っているつもりなので、
def open_dbm(filename, mode)
GDBM::open(filename, mode, GDBM::NOLOCK)
end
とし、同時にopenするのを許すようにしました。
Reply to #9376

Reply to #9387×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: Resource temporarily unavailable (2004-05-05 22:55 by Anonymous #9395)

対処ありがとうございます。
rev. 1.62 をテストしましたが、正しく対処されているようです。

なお、動作環境は

OS: FreeBSD 5.2.1-RELEASE-p5
NFS: 無
MTA: qmail
bsfilter は同一ホスト・同一ユーザで複数動作、それぞれデータベース更新有り。

でした。
Reply to #9373

Reply to #9395×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login