BIND 10 #419: Parallel xfrout session should be allowed
BIND 10 Development
do-not-reply at isc.org
Fri Feb 18 13:08:44 UTC 2011
#419: Parallel xfrout session should be allowed
-------------------------------------+-------------------------------------
Reporter: | Owner: zzchen_pku
zhanglikun | Status: reviewing
Type: defect | Milestone: A-Team-
Priority: major | Sprint-20110223
Component: xfrout | Resolution:
Keywords: | Sensitive: 0
Estimated Number of Hours: 0.0 | Add Hours to Ticket: 0
Billable?: 1 | Total Hours: 0
Internal?: 0 |
-------------------------------------+-------------------------------------
Changes (by vorner):
* owner: vorner => zzchen_pku
Comment:
Hello
I have serious problems understanding, why there's both
process_request_thread that seems to finish something off and
_handle_request_nonblock (which, in fact, seems to be blocking, so the
name seems little bit misleading).
However, I noticed one thing. New thread is started each time the socket
becomes readable. However, the reading itself is done inside the thread,
which brings a problem. The socket stays readable until everything that is
there is read. Imagine you start thread (because the socket is readable).
But before the thread reads all the data, another iteration of the select
loop is run, so another thread is started to read the same data.
And the read in the thread is not atomic. Imagine two requests come at
almost same time and two threads are started. First, one reads the file
descriptor and before it can read the request data, the second thread gets
CPU and tries to read file descriptor as well. But that will fail, because
there is the packet to handle, not fd.
May I suggest to read the request first and start the thread after reading
the data, only to handle the request? This way the read should be short
(as all data of the request should be sent at once) and parallel transfers
would be still handled in separate threads.
--
Ticket URL: <https://bind10.isc.org/ticket/419#comment:10>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development
More information about the bind10-tickets
mailing list