Github user shinrich commented on a diff in the pull request:

    https://github.com/apache/trafficserver/pull/754#discussion_r68956117
  
    --- Diff: iocore/net/UnixNetVConnection.cc ---
    @@ -556,13 +556,17 @@ write_to_net_io(NetHandler *nh, UnixNetVConnection 
*vc, EThread *thread)
         if (s->vio.ntodo() <= 0) {
           write_signal_done(VC_EVENT_WRITE_COMPLETE, nh, vc);
           return;
    -    } else if (signalled && (wbe_event != vc->write_buffer_empty_event)) {
    +    }
    +    int e = 0;
    +    if (!signalled) {
    +      e = VC_EVENT_WRITE_READY;
    +    } else if (wbe_event != vc->write_buffer_empty_event) {
           // @a signalled means we won't send an event, and the event values 
differing means we
           // had a write buffer trap and cleared it, so we need to send it now.
    -      if (write_signal_and_update(wbe_event, vc) != EVENT_CONT)
    -        return;
    -    } else if (!signalled) {
    -      if (write_signal_and_update(VC_EVENT_WRITE_READY, vc) != EVENT_CONT) 
{
    +      e = wbe_event;
    +    }
    +    if (e) {
    +      if (write_signal_and_update(e, vc) != EVENT_CONT) {
    --- End diff --
    
    Took me a bit to understand the point of this tidying up.  But looking back 
at the bug description, this rearrangement stops the early return which would 
miss the lock change detection.  So that makes sense.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to