Bug 178301 - lang/python27: Refine SEM option post-refactor
Summary: lang/python27: Refine SEM option post-refactor
Status: Closed Feedback Timeout
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Kubilay Kocak
URL:
Keywords: needs-qa, patch
Depends on:
Blocks:
 
Reported: 2013-05-02 20:40 UTC by Jan Beich
Modified: 2015-01-27 11:18 UTC (History)
1 user (show)

See Also:


Attachments
python_sem.diff (11.87 KB, patch)
2013-05-02 20:40 UTC, Jan Beich
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Beich freebsd_committer freebsd_triage 2013-05-02 20:40:01 UTC
python27 is always built with multiprocessing support on >= 9.0 or
on 7.1..8.4 with sem.ko preloaded because autoconf finds working
sem_open(). And python2[67] always USE_SEMAPHORES for locking which
seems to work fine with libthr's sem_init(pshared=0).

Fix: Just an incomplete attempt to make SEM more predictable:

  - remove checks for EOL releases
  - limit sem.ko warning and extra patches to 8.x users
  - warn 9.x users semaphores support cannot be disabled like in python3x
  - rely on autoconf to find sem_open et al. like netbsd or python3x
  - enable sem_open for python26 on >= 9.0 by default like python27
  - don't use semaphores for locking if SEM is unset on 8.x
How-To-Repeat: FreeBSD 9.0 or later:

$ python3.3 -c 'import multiprocessing.synchronize'
$ python2.7 -c 'import multiprocessing.synchronize'
$ python2.6 -c 'import multiprocessing.synchronize'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python2.6/multiprocessing/synchronize.py", line 33, in <module>
    " function, see issue 3770.")
ImportError: This platform lacks a functioning sem_open implementation, therefore, the required synchronization primitives needed will not function, see issue 3770.

FreeBSD 7.2..8.4:

$ python3.3 -c 'import multiprocessing.synchronize'
Traceback (most recent call last):
  File "/usr/local/lib/python3.3/multiprocessing/synchronize.py", line 27, in <module>
    from _multiprocessing import SemLock
ImportError: cannot import name SemLock

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python3.3/multiprocessing/synchronize.py", line 32, in <module>
    " function, see issue 3770.")
ImportError: This platform lacks a functioning sem_open implementation, therefore, the required synchronization primitives needed will not function, see issue 3770.

$ python2.7 -c 'import multiprocessing.synchronize'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python2.7/multiprocessing/synchronize.py", line 59, in <module>
    " function, see issue 3770.")
ImportError: This platform lacks a functioning sem_open implementation, therefore, the required synchronization primitives needed will not function, see issue 3770.

$ python2.6 -c 'import multiprocessing.synchronize'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python2.6/multiprocessing/synchronize.py", line 33, in <module>
    " function, see issue 3770.")
ImportError: This platform lacks a functioning sem_open implementation, therefore, the required synchronization primitives needed will not function, see issue 3770.
Comment 1 Jan Beich freebsd_committer freebsd_triage 2014-08-27 19:16:54 UTC
Abandoned.
Comment 2 Kubilay Kocak freebsd_committer freebsd_triage 2014-08-28 01:52:57 UTC
Hi Jan,

Now that python27 has been refactored using the new python34 baseline, and all python port OPTIONS have been made consistent, how can we further refine semaphore functionality/behaviour of the port?
Comment 3 Kubilay Kocak freebsd_committer freebsd_triage 2015-01-27 11:17:12 UTC
Jan,

Please re-open this issue if there's any improvements still to be made on the semaphore front, locally or upstream