Changeset 33932 in project


Ignore:
Timestamp:
04/04/17 20:38:28 (8 months ago)
Author:
sjamaan
Message:

http-client: Fix a regression in the closing of idle connections which would HANG EVERYTHING

Location:
release/4/http-client/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • release/4/http-client/trunk/http-client.scm

    r33931 r33932  
    237237      *idle-connections*
    238238      (lambda (uri conns)
    239         (for-each
    240          (lambda (con)
    241            (close-input-port (http-connection-inport con))
    242            (close-output-port (http-connection-outport con)))
    243          conns)
     239        (let lp ((to-close (cdr conns)))
     240          (unless (eq? to-close conns)
     241            (close-input-port (http-connection-inport (car to-close)))
     242            (close-output-port (http-connection-outport (car to-close)))
     243            (lp (cdr to-close))))
    244244        (hash-table-delete! *idle-connections* uri)))
    245245     (mutex-specific-set! *idle-connections-mutex* 0))))
  • release/4/http-client/trunk/tests/testlib.scm

    r33917 r33932  
    6868        (lambda ()
    6969          (handle-exceptions exn (thread-terminate! server-thread)
    70             (thread-join! server-thread 0))))
     70            ;; To close idle connections here to catch a regression
     71            ;; where we would loop endlessly...
     72            (close-idle-connections!)
     73            (thread-join! server-thread 0)) ))
    7174   
    7275    ;; Return the accumulated logs if all went well
Note: See TracChangeset for help on using the changeset viewer.