From hanno at hboeck.de Sun Aug 4 03:54:40 2019 From: hanno at hboeck.de (=?utf-8?q?Hanno_B=C3=B6ck?=) Date: Sun, 04 Aug 2019 07:54:40 -0000 Subject: [Bug 1838866] [NEW] Mailman 2.1: hardcoded site-packages dir prefix doesn't work on some 64 bit filesystem layouts Message-ID: <156490528078.28889.17410140899278165529.malonedeb@wampee.canonical.com> Public bug reported: Mailman's paths.py.in contains code to add the python site-packages dir to the path. This uses a hardcoded "lib" prefix: # Include Python's site-packages directory. sitedir = os.path.join(sys.prefix, 'lib', 'python'+sys.version[:3], 'site-packages') sys.path.append(sitedir) On 64 bit systems this is usually lib64 and some distros started removing the compatibility symlink lib->lib64 and split up lib and lib64 (e.g. latest Gentoo profiles). So relying on "lib" as a prefix is not compatible any more. Python has a function getsitepackages in the site module and I believe it's best to rely on python knowing best where its directories are. It returns an array, so this would look like this: sitedirs = site.getsitepackages() for sitedir in sitedirs: sys.path.append(sitedir) Patch attached, please apply. ** Affects: mailman Importance: Undecided Status: New ** Attachment added: "fix sitedir path on 64 bit filesystem layouts" https://bugs.launchpad.net/bugs/1838866/+attachment/5280705/+files/mailman-fix-sitedir.diff -- You received this bug notification because you are a member of Mailman Coders, which is subscribed to GNU Mailman. https://bugs.launchpad.net/bugs/1838866 Title: Mailman 2.1: hardcoded site-packages dir prefix doesn't work on some 64 bit filesystem layouts To manage notifications about this bug go to: https://bugs.launchpad.net/mailman/+bug/1838866/+subscriptions From 1839438 at bugs.launchpad.net Thu Aug 8 04:00:41 2019 From: 1839438 at bugs.launchpad.net (Hiroyuki Homma) Date: Thu, 08 Aug 2019 08:00:41 -0000 Subject: [Bug 1839438] [NEW] ESTALE in cluster configuration Message-ID: <156525124128.16542.13890475858347012646.malonedeb@soybean.canonical.com> Public bug reported: I am running a Mailman cluster with two servers sharing archives/data/lists/locks/spam directories. qfiles/logs directories are placed on each server's local volumes. Our environment is: CentOS 7.6 Mailman 2.1.29 GlusterFS 5.2 for shared volume. When I sent 1000 messages to the same list in 500 seconds (2 messages per second), about 20 messages has been shunted because of 'Stale file handle' error. Aug 06 15:14:45 2019 (15817) Uncaught runner exception: [Errno 116] Stale file handle Aug 06 15:14:45 2019 (15817) Traceback (most recent call last): File "/usr/lib/mailman/Mailman/Queue/Runner.py", line 119, in _oneloop self._onefile(msg, msgdata) File "/usr/lib/mailman/Mailman/Queue/Runner.py", line 165, in _onefile mlist = self._open_list(listname) File "/usr/lib/mailman/Mailman/Queue/Runner.py", line 208, in _open_list mlist = MailList.MailList(listname, lock=False) File "/usr/lib/mailman/Mailman/MailList.py", line 133, in __init__ self.Load() File "/usr/lib/mailman/Mailman/MailList.py", line 692, in Load dict, e = self.__load(file) File "/usr/lib/mailman/Mailman/MailList.py", line 663, in __load dict = loadfunc(fp) IOError: [Errno 116] Stale file handle Aug 06 15:14:45 2019 (15817) SHUNTING: 1565072084.945903+914cbad4e11aaa0523b7492edba5f4836db939d1 This happens when the recipient list's config.pck file is replaced by another server while reading it. ESTALE could happen normally on shared volumes, and in most case, simply retrying open/read is sufficient to recover the error. So I think a retry logic should be implemented in MailList._load() method. ** Affects: mailman Importance: Undecided Status: New -- You received this bug notification because you are a member of Mailman Coders, which is subscribed to GNU Mailman. https://bugs.launchpad.net/bugs/1839438 Title: ESTALE in cluster configuration To manage notifications about this bug go to: https://bugs.launchpad.net/mailman/+bug/1839438/+subscriptions From mark at msapiro.net Thu Aug 15 12:48:29 2019 From: mark at msapiro.net (Mark Sapiro) Date: Thu, 15 Aug 2019 16:48:29 -0000 Subject: [Bug 1838866] Re: Mailman 2.1: hardcoded site-packages dir prefix doesn't work on some 64 bit filesystem layouts References: <156490528078.28889.17410140899278165529.malonedeb@wampee.canonical.com> Message-ID: <156588770962.22451.12794641266927363468.malone@chaenomeles.canonical.com> I appreciate the patch. Thank you. One issue is that site.getsitepackages() requires Python 2.7. It is probably time to stop supporting older versions anyway, so this shouldn't be a problem. -- You received this bug notification because you are a member of Mailman Coders, which is subscribed to GNU Mailman. https://bugs.launchpad.net/bugs/1838866 Title: Mailman 2.1: hardcoded site-packages dir prefix doesn't work on some 64 bit filesystem layouts To manage notifications about this bug go to: https://bugs.launchpad.net/mailman/+bug/1838866/+subscriptions From mark at msapiro.net Thu Aug 15 19:09:25 2019 From: mark at msapiro.net (Mark Sapiro) Date: Thu, 15 Aug 2019 23:09:25 -0000 Subject: [Bug 1838866] Re: Mailman 2.1: hardcoded site-packages dir prefix doesn't work on some 64 bit filesystem layouts References: <156490528078.28889.17410140899278165529.malonedeb@wampee.canonical.com> Message-ID: <156591056538.16226.14962709352271131901.malone@wampee.canonical.com> I have now looked at the code for site.getsitepackages() at https://github.com/python/cpython/blob/master/Lib/site.py#L319 and it seems no better than what's in paths.py.in, so I'm not sure this will be effective unless your distro hacks site.py. Is that the case? It appears Ubuntu does hack site.getsitepackages() to actually return ['/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist- packages']. I am reluctant to do anything without a better understanding of what site.getsitepackages() returns in various distros. -- You received this bug notification because you are a member of Mailman Coders, which is subscribed to GNU Mailman. https://bugs.launchpad.net/bugs/1838866 Title: Mailman 2.1: hardcoded site-packages dir prefix doesn't work on some 64 bit filesystem layouts To manage notifications about this bug go to: https://bugs.launchpad.net/mailman/+bug/1838866/+subscriptions From hanno at hboeck.de Fri Aug 16 06:17:19 2019 From: hanno at hboeck.de (=?utf-8?q?Hanno_B=C3=B6ck?=) Date: Fri, 16 Aug 2019 10:17:19 -0000 Subject: [Bug 1838866] Re: Mailman 2.1: hardcoded site-packages dir prefix doesn't work on some 64 bit filesystem layouts References: <156490528078.28889.17410140899278165529.malonedeb@wampee.canonical.com> Message-ID: <156595063944.23197.13710812812566083294.malone@chaenomeles.canonical.com> I'm on Gentoo, seems it also patches the site.py accordingly: https://gitweb.gentoo.org/repo/gentoo.git/tree/dev- lang/python/python-2.7.16.ebuild#n106 -- You received this bug notification because you are a member of Mailman Coders, which is subscribed to GNU Mailman. https://bugs.launchpad.net/bugs/1838866 Title: Mailman 2.1: hardcoded site-packages dir prefix doesn't work on some 64 bit filesystem layouts To manage notifications about this bug go to: https://bugs.launchpad.net/mailman/+bug/1838866/+subscriptions From 1838866 at bugs.launchpad.net Fri Aug 16 11:24:47 2019 From: 1838866 at bugs.launchpad.net (Launchpad Bug Tracker) Date: Fri, 16 Aug 2019 15:24:47 -0000 Subject: [Bug 1838866] Re: Mailman 2.1: hardcoded site-packages dir prefix doesn't work on some 64 bit filesystem layouts References: <156490528078.28889.17410140899278165529.malonedeb@wampee.canonical.com> Message-ID: <156596909324.9566.4821547130631216921.launchpad@ackee.canonical.com> ** Branch linked: lp:mailman/2.1 -- You received this bug notification because you are a member of Mailman Coders, which is subscribed to GNU Mailman. https://bugs.launchpad.net/bugs/1838866 Title: Mailman 2.1: hardcoded site-packages dir prefix doesn't work on some 64 bit filesystem layouts To manage notifications about this bug go to: https://bugs.launchpad.net/mailman/+bug/1838866/+subscriptions From mark at msapiro.net Fri Aug 16 11:25:15 2019 From: mark at msapiro.net (Mark Sapiro) Date: Fri, 16 Aug 2019 15:25:15 -0000 Subject: [Bug 1838866] Re: Mailman 2.1: hardcoded site-packages dir prefix doesn't work on some 64 bit filesystem layouts References: <156490528078.28889.17410140899278165529.malonedeb@wampee.canonical.com> Message-ID: <156596911634.26794.7312657519374753040.launchpad@gac.canonical.com> ** Changed in: mailman Importance: Undecided => Low ** Changed in: mailman Status: New => Fix Committed ** Changed in: mailman Milestone: None => 2.1.30 ** Changed in: mailman Assignee: (unassigned) => Mark Sapiro (msapiro) -- You received this bug notification because you are a member of Mailman Coders, which is subscribed to GNU Mailman. https://bugs.launchpad.net/bugs/1838866 Title: Mailman 2.1: hardcoded site-packages dir prefix doesn't work on some 64 bit filesystem layouts To manage notifications about this bug go to: https://bugs.launchpad.net/mailman/+bug/1838866/+subscriptions From 1839438 at bugs.launchpad.net Thu Aug 29 04:36:08 2019 From: 1839438 at bugs.launchpad.net (Hiroyuki Homma) Date: Thu, 29 Aug 2019 08:36:08 -0000 Subject: [Bug 1839438] Re: ESTALE in cluster configuration References: <156525124128.16542.13890475858347012646.malonedeb@soybean.canonical.com> Message-ID: <156706776891.13543.13686622591372322775.malone@chaenomeles.canonical.com> ESTALE errors can also occures when closing a file, in LockFile.py and MailList.py: Aug 28 12:13:14 2019 (25794) Uncaught runner exception: [Errno 116] Stale file handle Aug 28 12:13:14 2019 (25794) Traceback (most recent call last): File "/usr/lib/mailman/Mailman/Queue/Runner.py", line 119, in _oneloop self._onefile(msg, msgdata) File "/usr/lib/mailman/Mailman/Queue/Runner.py", line 190, in _onefile keepqueued = self._dispose(mlist, msg, msgdata) File "/usr/lib/mailman/Mailman/Queue/IncomingRunner.py", line 115, in _dispose mlist.Lock(timeout=mm_cfg.LIST_LOCK_TIMEOUT) File "/usr/lib/mailman/Mailman/MailList.py", line 164, in Lock self.__lock.lock(timeout) File "/usr/lib/mailman/Mailman/LockFile.py", line 288, in lock elif self.__read() == self.__tmpfname: File "/usr/lib/mailman/Mailman/LockFile.py", line 432, in __read fp.close() IOError: [Errno 116] Stale file handle Aug 28 12:13:14 2019 (25794) SHUNTING: 1566961993.343576+720c68684e735dafb08c192202bfe1454009a201 Aug 29 13:05:15 2019 (27163) Uncaught runner exception: [Errno 116] Stale file handle Aug 29 13:05:15 2019 (27163) Traceback (most recent call last): File "/usr/lib/mailman/Mailman/Queue/Runner.py", line 119, in _oneloop self._onefile(msg, msgdata) File "/usr/lib/mailman/Mailman/Queue/Runner.py", line 165, in _onefile mlist = self._open_list(listname) File "/usr/lib/mailman/Mailman/Queue/Runner.py", line 208, in _open_list mlist = MailList.MailList(listname, lock=False) File "/usr/lib/mailman/Mailman/MailList.py", line 133, in __init__ self.Load() File "/usr/lib/mailman/Mailman/MailList.py", line 692, in Load dict, e = self.__load(file) File "/usr/lib/mailman/Mailman/MailList.py", line 670, in __load fp.close() IOError: [Errno 116] Stale file handle Aug 29 13:05:15 2019 (27163) SHUNTING: 1567051501.717527+7b52807884fed08cbdb6f523d1eddef1779ddfdb -- You received this bug notification because you are a member of Mailman Coders, which is subscribed to GNU Mailman. https://bugs.launchpad.net/bugs/1839438 Title: ESTALE in cluster configuration To manage notifications about this bug go to: https://bugs.launchpad.net/mailman/+bug/1839438/+subscriptions