We are testing the latest Mailman core 3.3.5 and Postorius 1.3.6. My colleagues reported that some email addresses cannot subscribe to the lists when two of them are using mass subscribe feature to add email addresses to the list. Then I try whether I can repeat the same issue. I did this:
1) Create two lists with default setting
2) Prepare a list of 1000 fresh email addresses not added to the system before
3) Mass subscribe both lists of these 1000 email addresses around the same time with all three Pre (confirm, approved, verified) checked
There are quite a lot of similar errors in mailman.log. Did not study the code yet. Which part is causing the issue?
[2021-10-28 08:38:30 +0000]  [ERROR] Error handling request /3.1/members
Traceback (most recent call last):
File "/opt/mailman/venv/lib/python3.6/site-packages/gunicorn/workers/sync.py", line 136, in handle
self.handle_request(listener, req, client, addr)
File "/opt/mailman/venv/lib/python3.6/site-packages/gunicorn/workers/sync.py", line 179, in handle_request
respiter = self.wsgi(environ, resp.start_response)
File "/opt/mailman/venv/lib/python3.6/site-packages/mailman/database/transaction.py", line 51, in wrapper
File "/opt/mailman/venv/lib/python3.6/site-packages/mailman/database/base.py", line 52, in commit
File "/opt/mailman/venv/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 1046, in commit
File "/opt/mailman/venv/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 502, in commit
File "/opt/mailman/venv/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 296, in _assert_active
sqlalchemy.exc.InvalidRequestError: This Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Session.rollback(). Original exception was: (raised as a result of Query-invoked autoflush; consider using a session.no_autoflush block if this flush is occurring prematurely)
(psycopg2.errors.UniqueViolation) duplicate key value violates unique constraint "ix_address_email"
DETAIL: Key (email)=(testemail999(a)example.com) already exists.