#49701 Ticket 48184 - clean up and delete connections at shutdown (2nd try)
Closed by spichugi. Opened by tbordaz.
tbordaz/389-ds-base Ticket-48184  into  master

Download 49701.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.

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

Fix Description: Close connections during shutdown rather than
leaving them alive.

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

Reviewed by:
Original was Ludwig and Viktor

Platforms tested: F26

Flag Day: no

Doc impact: no

Looks like "loop" is not being used, can it be removed? Or is there a retry limit you wanted to enforce?

Other than the issue with "loop", you get my ack

Nice. Yes it was for debug purpose to catch infinite looping event handler
I will remove it

rebased onto e562157ca3e97867d902996cc18fb04f90dc10a8

Pull-Request has been merged by mreynolds

Isn't there a "connection_make_readable" that already has the mutex for you (I may have added it in my connection patch perhaps ......)

In theory ''connection_make_readable'' should be similar to ''connection_make_readable_nolock'' except it acquires/releases the connection lock.
Unfortunately it is not the case :(

connection_make_readable_nolock seems dedicated to nunc-stans where it schedules ns_handle_pr_read_ready
And connection_readable signals the listener (non nunc-stans)

In addition, if we are running with nunc-stans disabled, connection_readable is no longer called where it should be IMHO

IMHO I think it is okay to call connection_make_readable_nolock with acquire/release lock, but this part of code need to be clean (may be using ns_connection_make_readable(_nolock)) and make sure we do call signal_listener when running without NS.

After a deeper look I think it is okay to deprecate ''connection_make_readable''. When NS is disabled it is important to signal the listener when a connection is no longer read (gettingber=0). This was the task of ''connection_make_readable''. But it was replaced by a direct call to signal_listener() each time gettingber is reset.

I will remove connection_make_readable on the next push

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/2760

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