Skip to content

Conversation

@clux
Copy link
Member

@clux clux commented Jan 8, 2021

trying to make it clear that a straight Api::watch is not recommended for anything but <a few minute watch times

/// ```
/// [`try_flatten_applied`]: super::utils::try_flatten_applied
/// [`reflector`]: super::reflector::reflector
/// [`Api::watch`]: https://docs.rs/kube/*/kube/struct.Api.html#method.watch
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought rustdoc was supposed to resolve these links automagically these days

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't able to get a cross-crate link to work :/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to work for tokio-util (https://docs.rs/tokio-util/0.6.0/src/tokio_util/context.rs.html#22).. which direction did you test in? Makes sense that it would be tricker for links from kube -> kube-runtime than the other way around.

Copy link
Member Author

@clux clux Jan 8, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They have the tokio::runtime::Runtime in scope 7 lines up. If we ever re-export kube_runtime from kube under a runtime feature (which I think we should aim to do), then within crate links will work from kube -> kube_runtime.

The other way around has the same problem for the time being.

Comment on lines 296 to 298
/// Note that a watch call __will terminate in <5 minutes__, based on [`ListParams::timeout`],
/// and as such, is best suited for __short term__ watches.
/// For continual tracking of resources, consider a managed [`watcher`].
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. The timeout parameter is just a hint to the server, which can really enforce whatever timeout it wants, so (in the long term) there isn't really a reliable threshold here for when Api::watch is safe
  2. There are other causes for errors here (network interruption, apiserver bugs, network topology changes, restarts), that you'd probably also want to recover from

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that is true, probably need to go through #334 and check how this interacts without defaults now. We should possibly remove the hard limit.

You are right. I'll reword it a bit. Possibly we should have some more convenience (or at least examples) around watchers that allow the same type of watch with an explicit timeout (without having to consider the other error cases).

clux and others added 4 commits January 8, 2021 15:19
Co-authored-by: Teo Klestrup Röijezon <teo.roijezon@interops.se>
Co-authored-by: Teo Klestrup Röijezon <teo.roijezon@interops.se>
Co-authored-by: Teo Klestrup Röijezon <teo.roijezon@interops.se>
also remove broken inferred link to TryFuture*
@clux clux merged commit 8611e5c into master Jan 8, 2021
@clux clux deleted the link-watch-watcher branch January 8, 2021 21:57
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.

3 participants