Skip to content
  • rswindell's avatar
    21dcf57b
    Fix race-condition during shutdown or recycle that could cause crash: · 21dcf57b
    rswindell authored
    active_clients (protected integer) could be 0 at the time of recycle because
    there can be delay at the beginning of the FTP ctrl thread (e.g. looking up
    filtered IPs/hostnames) before the active_clients is incremented which could
    be during/after it was destroyed by the cleanup() function. Now tracking
    number of threads using protected integer which increments immediately upon
    child thread creation and is not destroyed until the main thread terminates.
    There is currently *not* timeout while waiting for child threads to terminate
    upon shutdown/recycle, so this could result in a hung server thread if a child
    thread is indefinitely hung - consider using a timeout.
    21dcf57b
    Fix race-condition during shutdown or recycle that could cause crash:
    rswindell authored
    active_clients (protected integer) could be 0 at the time of recycle because
    there can be delay at the beginning of the FTP ctrl thread (e.g. looking up
    filtered IPs/hostnames) before the active_clients is incremented which could
    be during/after it was destroyed by the cleanup() function. Now tracking
    number of threads using protected integer which increments immediately upon
    child thread creation and is not destroyed until the main thread terminates.
    There is currently *not* timeout while waiting for child threads to terminate
    upon shutdown/recycle, so this could result in a hung server thread if a child
    thread is indefinitely hung - consider using a timeout.
Loading