#49737 Ticket 48184 - clean up and delete connections at shutdown (3rd)
Closed by spichugi. Opened by tbordaz.
tbordaz/389-ds-base Ticket-48184-3  into  master

Download 49737.patch

Bug description:
During shutdown we would not close connections.
In the past this may have just been an annoyance, but now with the way
nunc-stans works, io events can still trigger on open xeisting connectinos
during shutdown.

Fix Description:
Because of NS dynamic it can happen that several jobs wants to work on the
same connection. In such case (a job is already set in c_job) we delay the
new job that will retry.
In addition:
- some call needed c_mutex
- test uninitialized nunc-stans in case of shutdown while startup is not completed

If it is not possible to schedule immediately a job it is sometime useless to wait:
    - if the connection is already freed, just cancel the scheduled job
      and do not register a new one
    - If we are in middle of a shutdown we do not know if the
      scheduled job is ns_handle_closure, so cancel the scheduled
      job and schedule ns_handle_closure.

https://pagure.io/389-ds-base/issue/48184

Reviewed by:
Original was Ludwig and Viktor
Second fix reviewed by Mark

Platforms tested: F26

Flag Day: no

Doc impact: no

Should we be exiting the conn monitor here?

caller of ns_connection_post_io_or_closing should hold c_mutex
release of it will be done by the caller

Good point is to comment in the header of the function that caller must hold c_mutex

Thanks for the clarification, and yes please add a comment about the lock. After that it LGTM, ack!

rebased onto 085e99f705ec4eaaae1eee9d43edf5bcea528148

Pull-Request has been merged by tbordaz

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This pull request has been cloned to Github as issue and is available here:
- https://github.com/389ds/389-ds-base/issues/2796

If you want to continue to work on the PR, please navigate to the github issue,
download the patch from the attachments and file a new pull request.

Thank you for understanding. We apologize for all inconvenience.

Pull-Request has been closed by spichugi

Metadata