Thanks for the patch. Stefan Jakobs: > I'am not aware of any dead-lock issues. The sequence pseudo-thread > will query the database only once with the first key. For every > next key the sequence pseudo-thread is working with the results > in the memory. With a very large database the size of the response > may be a problem. But a INSERT/DELETE/UPDATE operation will not > conflict with the sequence pseudo-thread. Finally, I can not > prove if the code is dead-lock safe.
It appears that this sequence() implementation uses memory in proportion to the database size. That is not acceptable. Would it be possible to maintain state with a limited amount of memory for a database cursor? By design, Postfix memory usage must not keep growing with increasing data size, queue size, message size, database size etc. This is necessary to ensure sane handling of overload. It is not acceptable that Postfix becomes deadlocked under overload. The alternative would be to disable database cleanup by Postfix and to rely on other software to clean the databasem but that is a problem because the database format is not public. Wietse