feat: cache construction of records used to answer queries from the service registry#1243
Merged
Conversation
Codecov ReportPatch coverage is
📢 Thoughts on this report? Let us know!. |
bdraco
commented
Sep 2, 2023
bdraco
commented
Sep 2, 2023
Comment on lines
+187
to
+190
| self._dns_address_cache: Optional[List[DNSAddress]] = None | ||
| self._dns_pointer_cache: Optional[DNSPointer] = None | ||
| self._dns_service_cache: Optional[DNSService] = None | ||
| self._dns_text_cache: Optional[DNSText] = None |
Member
Author
There was a problem hiding this comment.
Ideally we would have required a subclass of ServiceInfo to be registered with the registry but thats a design choice we would have needed to make many years ago and would be a breaking change now
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Someone could be mutating the data after they register the
ServiceInfobut that would be wrong anyways since they should be callingasync_update_servicewith newServiceInfosince any changes wouldn't be broadcast anyways.This also has the risk of someone using the
ServiceInfo.dns_*calls in tests to mock data, butcreated=should be easy enough to remove for these cases.This is not as clean as I would have liked it to be as we have to maintain backwards compat for
override_ttl