-
Notifications
You must be signed in to change notification settings - Fork 330
feat(metrics): add cache metrics to dns-server #3800
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
base: main
Are you sure you want to change the base?
Conversation
|
Documentation for this PR has been generated and is available at: https://n0-computer.github.io/iroh/pr/3800/docs/iroh/ Last updated: 2025-12-22T14:47:05Z |
| ) -> Result<Option<Arc<RecordSet>>> { | ||
| trace!("store resolve"); | ||
| if let Some(rset) = self.cache.lock().await.resolve(pubkey, name, record_type) { | ||
| let mut cache = self.cache.lock().await; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will now hold a lock on the cache until the end of the function, which can include a DHT resolve which can take long. Whereas previously the lock would only be held shortly. If you do want to keep a lock around the guaranteed-to-be-fast operations, then I propose to do a block scopes ({ ... }) that makes it clear for how long the lock is held.
| .await | ||
| .insert_and_resolve_dht(&packet, name, record_type); | ||
| let result = cache.insert_and_resolve_dht(&packet, name, record_type); | ||
| self.metrics |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe move the metrics tracking into the cache itself? Then you can't miss updating it. (i.e. clone the metrics into ZoneCache and update the metrics whenever something changes from there.
| use quinn_proto::{ | ||
| VarInt, | ||
| coding::{Codec, UnexpectedEnd}, | ||
| coding::{Decodable, Encodable, UnexpectedEnd}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated change?
Description
Two simple gauges to just have basic info about the cache sizes at runtime.
Breaking Changes
Notes & open questions
Change checklist
quic-rpciroh-gossipiroh-blobsdumbpipesendme