python / cpython

The Python programming language
https://www.python.org
Other
62.59k stars 30.04k forks source link

Make socket support TIPC. #45987

Closed e0f31e0c-da6f-4279-abd9-ad954d4ae58e closed 16 years ago

e0f31e0c-da6f-4279-abd9-ad954d4ae58e commented 16 years ago
BPO 1646
Nosy @gvanrossum, @tiran
Files
  • 0001-Make-socket-support-TIPC.patch
  • 0002-Add-documentation-and-Misc-NEWS-entry-for-TIPC-suppo.patch
  • 0003-Add-unit-tests-for-TIPC-socket-support.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields: ```python assignee = 'https://github.com/tiran' closed_at = created_at = labels = ['type-feature', 'library'] title = 'Make socket support TIPC.' updated_at = user = 'https://bugs.python.org/albertito' ``` bugs.python.org fields: ```python activity = actor = 'christian.heimes' assignee = 'christian.heimes' closed = True closed_date = closer = 'christian.heimes' components = ['Library (Lib)'] creation = creator = 'albertito' dependencies = [] files = ['9092', '9093', '9094'] hgrepos = [] issue_num = 1646 keywords = ['patch'] message_count = 11.0 messages = ['58721', '58755', '58860', '58885', '58960', '59336', '59378', '59439', '59456', '59458', '59459'] nosy_count = 3.0 nosy_names = ['gvanrossum', 'christian.heimes', 'albertito'] pr_nums = [] priority = 'normal' resolution = 'fixed' stage = None status = 'closed' superseder = None type = 'enhancement' url = 'https://bugs.python.org/issue1646' versions = ['Python 2.6'] ```

    e0f31e0c-da6f-4279-abd9-ad954d4ae58e commented 16 years ago

    TIPC (http://tipc.sf.net) is an open protocol designed for use in clustered computer environments. It currently has an open source implementation for Linux (>= 2.6.16), and VxWorks.

    The attached patch (against trunk) adds optional Linux-only support for TIPC in the socket module.

    If you want me to make one against 3.0 or any other branch, just let me know.

    Thanks, Alberto

    gvanrossum commented 16 years ago

    I'm okay with adding this, it doesn't add much code and is properly safeguarded by #ifdefs and has a configure.in patch.

    I haven't reviewed the code though.

    e0f31e0c-da6f-4279-abd9-ad954d4ae58e commented 16 years ago

    On Tue, Dec 18, 2007 at 07:10:39PM -0000, Guido van Rossum wrote:

    Guido van Rossum added the comment:

    I'm okay with adding this, it doesn't add much code and is properly safeguarded by #ifdefs and has a configure.in patch.

    Thanks!

    Is there anything else I need to do in order to get this ready for inclusion?

    Thanks again, Alberto

    gvanrossum commented 16 years ago

    Tickle the interest of one of the many folks with commit privileges. Since 2.6 isn't going to be released for months there's no great hurry, but waiting until the last minute would be a mistake.

    tiran commented 16 years ago

    I've chatted with albertito a few days ago and adviced him to post the patch here. I'll take it.

    From the first review the patch looks good. The code is written cleanly and it uses the appropriate API. The new code is surrounded by ifdefs and it has a patch for configure.in. I'll do the autoreconf to update the other files locally.

    The patch is missing documentation updates, Misc/NEWS update and some unit tests. The docs should list the new constants and explain TIPC briefly in a few sentences. You don't need to write a novell ;)

    tiran commented 16 years ago

    *PING*

    I'm still waiting for a new patch. Your feature patch has been accepted but I won't commit it without doc updates.

    e0f31e0c-da6f-4279-abd9-ad954d4ae58e commented 16 years ago

    On Sat, Jan 05, 2008 at 10:08:15PM -0000, Christian Heimes wrote:

    I'm still waiting for a new patch. Your feature patch has been accepted but I won't commit it without doc updates.

    I know, but holidays were not the best time to write documentation.

    I'll probably send you the updated patch sometime this week; thanks for the ping =)

    Thanks, Alberto

    e0f31e0c-da6f-4279-abd9-ad954d4ae58e commented 16 years ago

    On Sun, Jan 06, 2008 at 02:45:35PM -0000, Alberto Bertogli wrote:

    I'll probably send you the updated patch sometime this week; thanks for the ping =)

    Here are the three patches, rebased to the SVN commit 59815.

    The first one is the same I've already submitted, the second adds the documentation and the third two testcases.

    The testcases are simple, but I think cover a reasonable amount of TIPC specific code. If you want more, let me know.

    The documentation is simple, as you told me, just a paragraph explaining about the address format and another explaining the constants. Again, if you want me to change anything, just let me know.

    Finally, if you want me to rebase this on top of any other branch, you guessed it, just let me know ;)

    Thanks a lot, Alberto

    tiran commented 16 years ago

    The unit tests don't work for me (Ubuntu 7.10, Linux 2.6.22, i386)

    >>> srv = socket.socket(socket.AF_TIPC, socket.SOCK_RDM)
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/home/heimes/dev/python/trunk/Lib/socket.py", line 177, in __init__
        _sock = _realsocket(family, type, proto)
    socket.error: [Errno 97] Address family not supported by protocol

    Do I have to set up my network device for TIPC?

    e0f31e0c-da6f-4279-abd9-ad954d4ae58e commented 16 years ago
    On Mon, Jan 07, 2008 at 03:37:54PM -0000, Christian Heimes wrote:
    > The unit tests don't work for me (Ubuntu 7.10, Linux 2.6.22, i386)
    > 
    > >>> srv = socket.socket(socket.AF_TIPC, socket.SOCK_RDM)
    > Traceback (most recent call last):
    >   File "<stdin>", line 1, in <module>
    >   File "/home/heimes/dev/python/trunk/Lib/socket.py", line 177, in __init__
    >     _sock = _realsocket(family, type, proto)
    > socket.error: [Errno 97] Address family not supported by protocol
    > 
    > Do I have to set up my network device for TIPC?

    No, by default you have a single-node cluster fully capable of TIPC networking. But you do need the TIPC module loaded; have you tried modprobe tipc?

    If that works, the test cases should pass.

    I understand that this might be a problem because there is no time to check at runtime if you have TIPC enabled in your kernel (besides the obvious way of trying to create the socket and see if it fails); but you have the same problem with any network protocol (although obviously is much more common to have TIPC disabled than the rest of the supported ones).

    Do you want me to check for this in the conditional for inclusion?

    Thanks, Alberto

    tiran commented 16 years ago

    Committed in r59819