BIND 10 #2410: race condition(?) in dhcp[46]_test.py

BIND 10 Development do-not-reply at isc.org
Thu Nov 22 19:24:21 UTC 2012


#2410: race condition(?) in dhcp[46]_test.py
-------------------------------------+-------------------------------------
                   Reporter:  jelte  |                 Owner:  marcin
                       Type:         |                Status:  reviewing
  defect                             |             Milestone:  Sprint-
                   Priority:         |  DHCP-20121129
  medium                             |            Resolution:
                  Component:  dhcp   |             Sensitive:  0
                   Keywords:         |           Sub-Project:  DHCP
            Defect Severity:  N/A    |  Estimated Difficulty:  4
Feature Depending on Ticket:         |           Total Hours:  0
        Add Hours to Ticket:  0      |
                  Internal?:  0      |
-------------------------------------+-------------------------------------
Changes (by stephen):

 * owner:  stephen => marcin


Comment:

 > It seems to me that in the future we could change os.spawn approach to
 subprocess.communicate as it is intended to replace old modules. That
 would also help to avoid race condition. Do we want to submit the ticket
 on this one?
 I think we need to leave the code as is.  Popen.comminicate reads stdout
 and stderr until an EOF is read, then waits for the process to terminate.
 This implicitly assumes that the process does communicate - whereas for
 some tests, we start up the process which outputs some text and enters its
 main loop.  We check the text then explicitly kill the process.

 >'''dhcp6_test.py'''
 > The code appears to have some redundancy. There are two variables:
 output and new_output...
 Fair point - it was a hangover from an attempt to accumulate output in
 multiple reads.  These variables have been removed.  In addition, some
 repeated code has been moved to a separate method and the "while" loop
 simplified.

-- 
Ticket URL: <http://bind10.isc.org/ticket/2410#comment:10>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development


More information about the bind10-tickets mailing list