BIND 10 #1542: socket creator protocol should distinguish socket level and other errors
BIND 10 Development
do-not-reply at isc.org
Thu Jan 26 23:50:22 UTC 2012
#1542: socket creator protocol should distinguish socket level and other errors
-------------------------------------+-------------------------------------
Reporter: | Owner: jinmei
jinmei | Status: reviewing
Type: | Milestone:
defect | Sprint-20120207
Priority: | Resolution:
blocker | Sensitive: 0
Component: Boss | Sub-Project: DNS
of BIND | Estimated Difficulty: 4
Keywords: | Total Hours: 0
Defect Severity: N/A |
Feature Depending on Ticket: |
Socket creator |
Add Hours to Ticket: 0 |
Internal?: 0 |
-------------------------------------+-------------------------------------
Comment (by jinmei):
Replying to [comment:5 vorner]:
First off, I've fixed one trivial error in the branch.
> I used exceptions (because it is easier to code, can contain more
information and the code using it doesn't need to be changed (yet) to
reflect the change). I derived a NonFatalSocketErorr (and used it as a
base for two other exceptions, so the user of the function can have more
details if he wants so) from the SocketError.
I personally don't like to overuse exceptions for something we can
expect (and in either case it's better if we have some consistent
guideline of when to use exceptions in this context (i.e. not in the
safety vs resilience context)), but that's probably a separate general
discussion. So I won't fight against it in the context of this
ticket.
> Should the code using it do something special now? Because currently it
just rejects the configuration, no matter which error it is.
The user part should probably be left to a separate ticket, because
it's related to a topic of how to revise port binding configuration.
But I'd like to make sure that one is also handled soon rather than
just using it as an easy excuse of not doing it here.
I think there's already a related ticket. If not we need to create
one.
As for the branch itself, I have just a few minor comments:
'''general'''
I'd like to avoid hardcode numbers like "2" or "3", and ideally
centralize the definition of these. one possible way is to introduce a
central C++ header file and share the definition for python via a
binding, but in this case this might be overkilling. So defining them
both in C++ and in python consistently may be a compromise.
'''bind10_test'''
Shouldn't we also update check_code() so that it will check other
cases of non 0 code?
'''socket_request'''
- I'd like to explicitly clarify that NonFatalSocketError doesn't
break the socket state (so the caller can safely keep using it).
- s/operation system/operating system/?
{{{#!c++
/// \brief Exception when the operation system doesn't allow us to
create
/// the requested socket.
}}}
--
Ticket URL: <http://bind10.isc.org/ticket/1542#comment:7>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development
More information about the bind10-tickets
mailing list