[Freeipa-devel] [PATCHES][SSSD] SBUS Reconnection logic

Stephen Gallagher sgallagh at redhat.com
Thu Mar 19 16:20:27 UTC 2009


Stephen Gallagher wrote:
> Simo Sorce wrote:
>> On Wed, 2009-03-18 at 12:22 -0400, Stephen Gallagher wrote:
>>> +static void be_cli_reconnect_init(struct sbus_conn_ctx *sconn, int
>>> status, void *pvt)
>>> +{
>>> +    int ret;
>>> +    struct be_ctx *be_ctx = talloc_get_type(pvt, struct be_ctx);
>>> +
>>> +    /* Did we reconnect successfully? */
>>> +    if (status == SBUS_RECONNECT_SUCCESS) {
>>> +        /* Add the methods back to the new connection */
>>> +        ret = sbus_conn_add_method_ctx(be_ctx->dp_ctx->scon_ctx,
>>> +                                       be_ctx->dp_ctx->sm_ctx);
>>> +        if (ret != EOK) {
>>> +            DEBUG(0, ("Could not re-add methods on
>>> reconnection.\n"));
>>> +            be_finalize(be_ctx);
>>> +        }
>> don't you miss a return statement here right after be_finalize ?
>>
>>> +        DEBUG(1, ("Reconnected to the Data Provider.\n"));
>>> +        return;
>>> +    }
>>> +
>>> +    /* Handle failure */
>>> +    DEBUG(0, ("Could not reconnect to data provider.\n"));
>>> +    /* Kill the backend and let the monitor restart it */
>>> +    be_finalize(be_ctx);
>>> +}
>> Also why be_finalize is a void * ? Doesn't it make sense to be able to
>> return an errno so we can add a debug statement that explain what got
>> wrong ?
>>
>> Simo.
>>
>>
> 
> 
> New patch attached (I attached both again, for reference, but only the
> back-end patch has changed)
> 
> I've made the recommended changes above. Please review.
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Freeipa-devel mailing list
> Freeipa-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/freeipa-devel

Sorry, resent the wrong patch.


-- 
Stephen Gallagher
RHCE 804006346421761

Looking to carve out IT costs?
www.redhat.com/carveoutcosts/
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0002-Enable-autoreconnection-of-Data-Provider-Backends-to.patch
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20090319/168fc853/attachment.ksh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 259 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20090319/168fc853/attachment.sig>


More information about the Freeipa-devel mailing list