Sascha Steinbiss pushed to branch master at Debian Med / ariba


Commits:
c1cd888f by Sascha Steinbiss at 2026-07-05T23:19:23+02:00
add patch to make code work with Python 3.14's multiprocessing

- - - - -


3 changed files:

- debian/changelog
- + debian/patches/multiprocessing-py3.14.patch
- debian/patches/series


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,10 @@
+ariba (2.14.7+ds-13) unstable; urgency=medium
+
+  * Add patch to make code compatible with Python 3.14's multiprocessing.
+    (Closes: #1141163)
+
+ -- Sascha Steinbiss <[email protected]>  Sun, 05 Jul 2026 23:10:35 +0200
+
 ariba (2.14.7+ds-12) unstable; urgency=medium
 
   * Team Upload


=====================================
debian/patches/multiprocessing-py3.14.patch
=====================================
@@ -0,0 +1,28 @@
+Description: adapt to new multiprocessing code
+ Adapts the code to Python 3.14's change from fork to forkserver as the default
+ multiprocessing start method, which causes ConnectionResetError when using
+ multiprocessing.Manager() in certain environments (chroots, containers).
+Author: Sascha Steinbiss <[email protected]>
+Last-Update: 2026-07-05
+--- a/ariba/clusters.py
++++ b/ariba/clusters.py
+@@ -462,14 +462,17 @@
+         # memory, and thus bypass the NFS issues. The counter is accesses 
infrequently
+         # relative to computations, so the performance does not suffer.
+         # default authkey in the manager will be some generated 
random-looking string
+-        manager = multiprocessing.Manager()
++        # Use 'fork' context explicitly to avoid Python 3.14's default 
'forkserver' which
++        # can cause ConnectionResetError in certain environments (e.g., 
chroot, containers)
++        ctx = multiprocessing.get_context('fork')
++        manager = ctx.Manager()
+         remaining_clusters = manager.Value('l',len(cluster_list))
+         # manager.Value does not provide access to the internal RLock that we 
need for
+         # implementing atomic -=, so we need to carry around a separate RLock 
object.
+         remaining_clusters_lock = manager.RLock()
+         try:
+             if self.threads > 1:
+-                self.pool = multiprocessing.Pool(self.threads)
++                self.pool = ctx.Pool(self.threads)
+                 cluster_list = self.pool.starmap(_run_cluster, 
zip(cluster_list, itertools.repeat(self.verbose), itertools.repeat(self.clean), 
itertools.repeat(self.fails_dir),
+                                                                    
itertools.repeat(remaining_clusters),itertools.repeat(remaining_clusters_lock)))
+                 # harvest the pool as soon as we no longer need it


=====================================
debian/patches/series
=====================================
@@ -8,3 +8,4 @@ python3.12.patch
 python3.12_syntax_warning.patch
 py3.13.patch
 remove_pkg_resources.patch
+multiprocessing-py3.14.patch



View it on GitLab: 
https://salsa.debian.org/med-team/ariba/-/commit/c1cd888fa41688916f1765604119c78912f6b3e9

-- 
View it on GitLab: 
https://salsa.debian.org/med-team/ariba/-/commit/c1cd888fa41688916f1765604119c78912f6b3e9
You're receiving this email because of your account on salsa.debian.org. Manage 
all notifications: https://salsa.debian.org/-/profile/notifications | Help: 
https://salsa.debian.org/help


_______________________________________________
debian-med-commit mailing list
[email protected]
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/debian-med-commit

Reply via email to