You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently struggling with appropriately disconnecting the external client after it was used.
My Reconciler is created with WithExternalConnectDisconnecterhere
I implemented the connect and disconnect method. But disconnect does not have any further specific parameters, so it seems to be intended to close the whole Connector. But there is only one Connector per Reconciler. Meaning if the Connectorś disconnect method is called and then the Reconciler.Reconcile gets another call it will call Connect() on an already Disconnected connector.
Currently the Disconnect call is: r.external.Disconnect(ctx);
Proposal
Wouldn´t it be better to pass either external as a parameter to disconnect r.external.Disconnect(ctx, external);
or directly call Disconnect on external (without r.) external.Disconnect(ctx)
Benefit is, that we can close precisely an reconcile call scoped client. And not disconnect the whole connector of the reconciler, though it is still in use and might run another reconcile
The text was updated successfully, but these errors were encountered:
Problem
I am currently struggling with appropriately disconnecting the external client after it was used.
My Reconciler is created with
WithExternalConnectDisconnecter
hereI implemented the connect and disconnect method. But disconnect does not have any further specific parameters, so it seems to be intended to close the whole Connector. But there is only one Connector per Reconciler. Meaning if the Connectorś disconnect method is called and then the
Reconciler.Reconcile
gets another call it will call Connect() on an already Disconnected connector.crossplane-runtime/pkg/reconciler/managed/reconciler.go
Lines 892 to 912 in fc03661
Currently the Disconnect call is:
r.external.Disconnect(ctx);
Proposal
Wouldn´t it be better to pass either
external
as a parameter to disconnectr.external.Disconnect(ctx, external);
or directly call Disconnect on external (without
r.
)external.Disconnect(ctx)
Benefit is, that we can close precisely an reconcile call scoped client. And not disconnect the whole connector of the reconciler, though it is still in use and might run another reconcile
The text was updated successfully, but these errors were encountered: