Fix traceback to correctly deal with source port already in use errors
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
py3dns | Status tracked in Trunk | |||||
3.0 |
Fix Committed
|
High
|
Unassigned | |||
Trunk |
Fix Released
|
High
|
Unassigned | |||
py3dns (Ubuntu) |
Fix Released
|
High
|
Unassigned | |||
Precise |
Won't Fix
|
Low
|
Unassigned | |||
Quantal |
Won't Fix
|
Low
|
Unassigned | |||
Saucy |
Won't Fix
|
Low
|
Unassigned | |||
Trusty |
Fix Released
|
High
|
Scott Kitterman | |||
Utopic |
Fix Released
|
High
|
Unassigned |
Bug Description
[Impact]
* Causes random tracebacks on DNS lookups when break functionality of packages that use the module. In the case the bug was filed for, the impact would be a postfix server returning servfail and deferring message traffic.
* The code represents a missed change for the port from python to python3.
[Test Case]
* This bug only happens when multiple DNS queries attempt to use the same port at the same time. It's very difficult to reproduce and as far as I know impossible to do it consistently. The attached script demonstrates the new code working and the old code failing. That and code inspection are the best ways to verify this.
[Regression Potential]
* Regression potential is nil.
Note: This is an extract from a private bug.
Traceback (most recent call last):
File "/usr/lib/
self.s.bind(('', source_port))
OSError: [Errno 98] Address already in use
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/
instance_dict, configData, peruser)
File "/usr/bin/
res = spf.check2(ip, sender, helo)
File "/usr/lib/
receiver=
File "/usr/lib/
spf = self.dns_
File "/usr/lib/
a = [t for t in self.dns_
File "/usr/lib/
dns_list = self.dns(
File "/usr/lib/
for k, v in DNSLookup(name, qtype, self.strict, timeout):
File "/usr/lib/
resp = req.req()
File "/usr/lib/
self.sendUDPReq
File "/usr/lib/
self.conn()
File "/usr/lib/
self.getSource()
File "/usr/lib/
if msg[0] != 98: raise
TypeError: 'OSError' object is not subscriptable
warning: missing attribute action in input from private/policyd-spf
warning: command /usr/bin/
Note that the policy server exiting non-zero will intefere with mail delivery.
Fixed upstream in 3.1.0 and in trunk for the 3.0 branch for if that's ever released again.