You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RDS is a reliable datagram protocol used by Oracle clusters for inter-process communication. It is in the Linux kernel, and has a defined address family number. Its use is identical to UDP, except the address family is 21, and the type is SOCK_SEQPACKET.
So, what's this got to do with Python? :)
Apparently Modules/socketmodule.c getsockaddrarg() checks bind() args, and only allows known socket types to bind. Attempting to bind with an RDS socket fails.
It looks pretty straightforward to add support for a new family, but before doing so I wanted to check whether this was likely to be accepted, and also to ask if it wouldn't make more sense for getsockaddrarg() to not default to failing unknown families, but instead letting them through? If the params are wrong for a non-enumerated family, bind() will presumably return an error that the user will get.
A patch has good chances of getting accepted (eventually; it may take several months or years). Test cases and documentation changes should be included.
Supporting generic socket addresses can't work (IMO): how could Python possibly know how to map a Python representation of the address (which is likely a tuple of some kind) onto a struct sockaddr?
neologix commented on Nov 1, 2011
neologixmannequin
Mannequin
More actions
Here's a patch adding support for RDS sockets (with test and documentation update).
the tests are skipped with "unable to bind RDS socket" here (even under root). Is it expected?
socket.error is the same as OSError now
there are some ResourceWarnings abount unclosed sockets when running the tests
neologix commented on Nov 1, 2011
neologixmannequin
Mannequin
More actions
the tests are skipped with "unable to bind RDS socket" here (even
under root). Is it expected?
Oops. I did a quick test to force the socket family (because RDS sockets really use sockaddr_in), and apparently I overwrote my original patch... Here's the correct one.
As long as the rds module is loaded, all the tests should pass.
socket.error is the same as OSError now
I changed this in this patch.
I'll update the other occurrences in test_socket in a separate patch.
there are some ResourceWarnings abount unclosed sockets when
running the tests
Same thing here, I fixed those in my original patch, then somehow overwrote it with a previous version...
I didn't add control messages tests: they all pertain to RDMA, which is rather tricky to test to test from Python (and my header files don't define them)
loewis commented on Nov 6, 2011
loewismannequin
Mannequin
More actions
Not having tests for the control messages is fine with me - we don't need to test Linux, but Python.
Activity
AndrewGrover commentedon Jan 25, 2010
RDS is a reliable datagram protocol used by Oracle clusters for inter-process communication. It is in the Linux kernel, and has a defined address family number. Its use is identical to UDP, except the address family is 21, and the type is SOCK_SEQPACKET.
So, what's this got to do with Python? :)
Apparently Modules/socketmodule.c getsockaddrarg() checks bind() args, and only allows known socket types to bind. Attempting to bind with an RDS socket fails.
It looks pretty straightforward to add support for a new family, but before doing so I wanted to check whether this was likely to be accepted, and also to ask if it wouldn't make more sense for getsockaddrarg() to not default to failing unknown families, but instead letting them through? If the params are wrong for a non-enumerated family, bind() will presumably return an error that the user will get.
loewis commentedon Jan 25, 2010
A patch has good chances of getting accepted (eventually; it may take several months or years). Test cases and documentation changes should be included.
Supporting generic socket addresses can't work (IMO): how could Python possibly know how to map a Python representation of the address (which is likely a tuple of some kind) onto a struct sockaddr?
neologix commentedon Nov 1, 2011
Here's a patch adding support for RDS sockets (with test and documentation update).
pitrou commentedon Nov 1, 2011
A couple of things:
neologix commentedon Nov 1, 2011
Oops. I did a quick test to force the socket family (because RDS sockets really use sockaddr_in), and apparently I overwrote my original patch... Here's the correct one.
As long as the
rdsmodule is loaded, all the tests should pass.I changed this in this patch.
I'll update the other occurrences in test_socket in a separate patch.
Same thing here, I fixed those in my original patch, then somehow overwrote it with a previous version...
neologix commentedon Nov 5, 2011
So, what do you think of the new patch?
pitrou commentedon Nov 5, 2011
Oops, sorry. I wonder if it would be possible to test the address returned by recvfrom(). Same for the flags and ancillary data in recvmsg().
loewis commentedon Nov 6, 2011
I think the patch currently lacks a lot of symbolic constants; see my review.
neologix commentedon Nov 6, 2011
Here's an updated patch:
I've also added a bunch of constants:
loewis commentedon Nov 6, 2011
Not having tests for the control messages is fine with me - we don't need to test Linux, but Python.
python-dev commentedon Nov 10, 2011
New changeset 2293ca739223 by Charles-François Natali in branch 'default':
Issue bpo-7777: socket: Add Reliable Datagram Sockets (PF_RDS) support.
http://hg.python.org/cpython/rev/2293ca739223