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

feat: verify to support Cache Flush on Failure Indication #267

Merged
merged 9 commits into from
Nov 17, 2024
Merged

Conversation

keepsimple1
Copy link
Owner

@keepsimple1 keepsimple1 commented Nov 9, 2024

This patch is to resolve issue #54 by implement a function to support Cache Flush on Failure Indication

A new API of ServiceDaemon is added:

    pub fn verify_resource(&self, resource: DnsResource, timeout: Duration) -> Result<()>

The idea is that, a querier can call this API anytime to verify if the service records still valid. A ServiceRemoved event will be triggered if no response in timeout.

DnsResource supports SRV record and ADDR record at this moment.

For convenience, VERIFY_RESOURCE_TIMEOUT_DEFAULT is defined for timeout.

UPDATE:

I simplified the new API based on this thought: (most) users would not make 2 calls to verify service_instance_name and hostname for one service instance. The user should be able to call just once to verify a service instance. The library will send query for both SRV and ADDR records internally.

The API now is this:

    pub fn verify(&self, instance_fullname: String, timeout: Duration) -> Result<()> 

@keepsimple1 keepsimple1 changed the title feat: verify_resource to support Cache Flush on Failure Indication feat: verify to support Cache Flush on Failure Indication Nov 9, 2024
@keepsimple1 keepsimple1 merged commit 1ade666 into main Nov 17, 2024
3 checks passed
@keepsimple1 keepsimple1 deleted the verify branch November 17, 2024 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant