Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close method on Resolver interface #1472

Closed
jjcollinge opened this issue Feb 3, 2022 · 13 comments
Closed

Close method on Resolver interface #1472

jjcollinge opened this issue Feb 3, 2022 · 13 comments
Assignees
Labels
Milestone

Comments

@jjcollinge
Copy link
Contributor

Ask your question here

I'm not sure if there's already been discussions around this topic (I can't find any) - is there any reason we cannot add a Close() method to the resolver interface to allow any components that use stateful services to unregister? This would allow Consul and mDNS to shutdown correctly without leaving orphaned services. The change would be additive (non-breaking) so was wondering if anyone else had looked into this and found a good reason not to add this?

@daixiang0
Copy link
Member

Agree to add it.

@dapr-bot
Copy link
Collaborator

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged (pinned, good first issue, help wanted or triaged/resolved) or other activity occurs. Thank you for your contributions.

@dapr-bot dapr-bot added the stale label Mar 10, 2022
@mukundansundar
Copy link
Contributor

Agree to this.

@dapr/maintainers-components-contrib
Labels to add: P1 size:xs good-first-issue area/runtime/nameresolution triaged/resolved

@dapr-bot dapr-bot removed the stale label Mar 12, 2022
@jjcollinge
Copy link
Contributor Author

I'm happy to implement this @mukundansundar - could you please assign me so I can track it.

@jjcollinge jjcollinge mentioned this issue Mar 18, 2022
3 tasks
@mukundansundar
Copy link
Contributor

@jjcollinge please use /assign to assign yourself to the issue.

@jjcollinge
Copy link
Contributor Author

/assign

@dapr-bot
Copy link
Collaborator

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged (pinned, good first issue, help wanted or triaged/resolved) or other activity occurs. Thank you for your contributions.

@dapr-bot dapr-bot added the stale label Apr 17, 2022
@mukundansundar
Copy link
Contributor

not-stale

@dapr-bot dapr-bot removed the stale label Apr 18, 2022
@dapr-bot
Copy link
Collaborator

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged (pinned, good first issue, help wanted or triaged/resolved) or other activity occurs. Thank you for your contributions.

@ItalyPaleAle
Copy link
Contributor

@berndverst We don't necessarily need to update the interface for this. It can be implemented as an optional Close() error method.

The runtime is already checking, upon termination, if components implement io.Closer (e.g. Close() error), and if they do, it invokes them:

https://github.com/dapr/dapr/blob/ccce9e451a4b96d1d21a7688196ee7aa89654d6f/pkg/runtime/runtime.go#L2652-L2660

@berndverst
Copy link
Member

@berndverst We don't necessarily need to update the interface for this. It can be implemented as an optional Close() error method.

The runtime is already checking, upon termination, if components implement io.Closer (e.g. Close() error), and if they do, it invokes them:

https://github.com/dapr/dapr/blob/ccce9e451a4b96d1d21a7688196ee7aa89654d6f/pkg/runtime/runtime.go#L2652-L2660

That works.

@berndverst berndverst added the good first issue Good for newcomers label Jan 18, 2023
@ItalyPaleAle
Copy link
Contributor

I think this issue can be closed.

mDNS already implements the Close() method that disposes of resources.

Consul doesn't, but if that's needed, IMHO that's an issue specific to the component and not about the general interface for the resolvers. So should be a separate issue...

@berndverst berndverst modified the milestones: v1.11, v1.12 May 30, 2023
@artursouza artursouza assigned jjcollinge and unassigned jjcollinge Jun 30, 2023
@artursouza artursouza modified the milestones: v1.12, v1.10 Jun 30, 2023
@artursouza
Copy link
Member

It was done a while ago, marked as closed and moved to 1.10 since @ItalyPaleAle suggested that might be the correct timeline for that change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants