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

2020 tower spring cleaning #431

Closed
14 of 33 tasks
jonhoo opened this issue Mar 31, 2020 · 12 comments
Closed
14 of 33 tasks

2020 tower spring cleaning #431

jonhoo opened this issue Mar 31, 2020 · 12 comments
Assignees
Labels
E-help-wanted Call for participation: Help is requested to fix this issue. E-medium Call for participation: Experience needed to fix: Medium / intermediate metabug Issues about issues themselves ("bugs about bugs") relnotes Marks issues that should be documented in the release notes of the next release. T-docs Topic: documentation
Milestone

Comments

@jonhoo
Copy link
Collaborator

jonhoo commented Mar 31, 2020

It's about time we made a serious push to make tower "ready for public use". Here is a list of what should happen to make that a reality:

For the per-crate/module docs cleanup, here are the things we need to do, what we have done, and who's going to do each one. If you want to make a pass over one of these, please post here to claim so we don't duplicate the work. As you make your pass, please also create issues for implementation and API issues you spot (for example, limit should probably not vendor parts of tokio::sync).

Things we would also like to do, but are not blockers:

  • Create more GitHub issue labels, especially one for each module.
  • Triage all GitHub issues, apply appropriate labels, close stale issues.
  • Triage all current GitHub PRs, and make steps to move each one forward (may just consist of pinging the author).
@hawkw
Copy link
Member

hawkw commented Mar 31, 2020

* Update _all_ docs to at least have all items documented (`#![deny(missing_docs)]`) and basic usage examples + module docs. We should also tidy up the `README` + crate docs + metadata while we're at it. See also #33.

We should probably also add the doc_cfg nightly feature to docs.rs builds, and add the appropriate attributes to feature-flagged APIs (similar to tonic, tokio, etc).

@jonhoo
Copy link
Collaborator Author

jonhoo commented Mar 31, 2020

I've updated the v0.3.x branch to point to the current head of master (0f9eb64). Going forward, master will be where we develop the "new and shiny", and then any maintenance of the 0.3 releases will happen on v0.3.x. The thinking is that this will incentivize us to get a new tower release out as soon as we can, to minimize the time that there is a mismatch between master and the code that people get through crates.io.

@jonhoo
Copy link
Collaborator Author

jonhoo commented Mar 31, 2020

We now have tons of fancy new labels.

@jonhoo jonhoo added E-easy Call for participation: Experience needed to fix: Easy / not much E-help-wanted Call for participation: Help is requested to fix this issue. metabug Issues about issues themselves ("bugs about bugs") relnotes Marks issues that should be documented in the release notes of the next release. T-docs Topic: documentation labels Mar 31, 2020
@davidbarsky
Copy link
Contributor

@jonhoo A few notes on poll_ready:

  • I think Tower should move to the model with an explicit semaphore, but I'm not sure this requires a new associated type.
  • I'd also like to see a corresponding high-level trait (called Dispatch, maybe? Bikesheds welcome) which does not expose a public poll_ready method and changes the call method to take &self introduced alongside the new Service trait, as Service is getting more and more low-level.
  • If tower::Service moves to a semaphore-based approach, is there any value in keeping &mut self around? Tokens + &self could reduce how many .clone()s need to be written.

@jonhoo
Copy link
Collaborator Author

jonhoo commented Mar 31, 2020

I did triage!

@jonhoo
Copy link
Collaborator Author

jonhoo commented Mar 31, 2020

@davidbarsky Can you say more about what you mean by "explicit semaphore". Are you thinking about #412, or something else? Also, I'm not sure I follow why Dispatch would be useful?

@jonhoo
Copy link
Collaborator Author

jonhoo commented Mar 31, 2020

Also, I wonder if we should keep the discussion of poll_ready to #408. Or maybe we (you? :p) should make a new meta-issue specifically about poll_ready? And then arguably close #408 and #412, since they are both specific proposals, both of which can be folded into one bigger discussion around poll_ready.

@hawkw
Copy link
Member

hawkw commented Mar 31, 2020

@davidbarsky

  • I'd also like to see a corresponding high-level trait (called Dispatch, maybe? Bikesheds welcome) which does not expose a public poll_ready method and changes the call method to take &self introduced alongside the new Service trait, as Service is getting more and more low-level.

This sounds a lot like the ReadyService trait that was added in #25 and then removed in #50. IIRC, there were some issues with ReadyService that lead to its removal. We should probably do some thinking about whether those issues still apply before reintroducing a similar trait.

  • I think Tower should move to the model with an explicit semaphore, but I'm not sure this requires a new associated type.

What do you mean by "explicit semaphore"? If you're proposing adding a semaphore-based concurrency control mechanism to every service, I'm not sure how I feel about that. Many services (including most middleware services) don't require their own concurrency control, just propagating backpressure from lower-level services up the stack. Am I understanding what you mean correctly?

@davidbarsky
Copy link
Contributor

@jonhoo Yeah, some sort of dedicated issue for poll_ready is a good idea. I'll create one later today once I clear this morning's round of meetings.

@hawkw

This sounds a lot like the ReadyService trait that was added in #25 and then removed in #50. IIRC, there were some issues with ReadyService that lead to its removal. We should probably do some thinking about whether those issues still apply before reintroducing a similar trait.

Ah, good to know. I'll take a look at that those two issues.

What do you mean by "explicit semaphore"? If you're proposing adding a semaphore-based concurrency control mechanism to every service, I'm not sure how I feel about that. Many services (including most middleware services) don't require their own concurrency control, just propagating backpressure from lower-level services up the stack. Am I understanding what you mean correctly?

By "explicit semaphore", I was referring to the proposal outlined in #412. Backpressure would be propagated by passing a token up through the Service stack rather than relying on each Service to call poll_ready() themselves. That being said, the Lock approach you mentioned that exists in Linkerd might be a compelling alternative.

@jonhoo
Copy link
Collaborator Author

jonhoo commented Apr 1, 2020

(@davidbarsky see also rust-lang/futures-rs#2109, which is my primary consideration for poll_ready)

@jonhoo jonhoo added E-help-wanted Call for participation: Help is requested to fix this issue. E-medium Call for participation: Experience needed to fix: Medium / intermediate and removed E-easy Call for participation: Experience needed to fix: Easy / not much E-help-wanted Call for participation: Help is requested to fix this issue. labels Apr 1, 2020
@jonhoo
Copy link
Collaborator Author

jonhoo commented Apr 17, 2020

Fixed the docs feature annotations and publish = false in #442.

@jonhoo jonhoo pinned this issue May 5, 2020
hdevalence added a commit to ZcashFoundation/zebra that referenced this issue Sep 21, 2020
This addresses at least three pain points:

- we were affected by bugs that were already fixed in git, but not in
  the released crate;
- we can use service combinators to transform requests and responses;
- we can use the hedge middleware.

The version in git is still marked as 0.3.1 but these changes will be
part of tower 0.4: tower-rs/tower#431
hdevalence added a commit to ZcashFoundation/zebra that referenced this issue Sep 21, 2020
This addresses at least three pain points:

- we were affected by bugs that were already fixed in git, but not in
  the released crate;
- we can use service combinators to transform requests and responses;
- we can use the hedge middleware.

The version in git is still marked as 0.3.1 but these changes will be
part of tower 0.4: tower-rs/tower#431
hdevalence added a commit to ZcashFoundation/zebra that referenced this issue Sep 21, 2020
This addresses at least three pain points:

- we were affected by bugs that were already fixed in git, but not in
  the released crate;
- we can use service combinators to transform requests and responses;
- we can use the hedge middleware.

The version in git is still marked as 0.3.1 but these changes will be
part of tower 0.4: tower-rs/tower#431
@LucioFranco LucioFranco added this to the v0.4 milestone Nov 27, 2020
@hawkw
Copy link
Member

hawkw commented Jan 12, 2021

Now that 0.4 has been shipped, I think we can call this "done"!

@hawkw hawkw closed this as completed Jan 12, 2021
@hawkw hawkw unpinned this issue Jan 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-help-wanted Call for participation: Help is requested to fix this issue. E-medium Call for participation: Experience needed to fix: Medium / intermediate metabug Issues about issues themselves ("bugs about bugs") relnotes Marks issues that should be documented in the release notes of the next release. T-docs Topic: documentation
Projects
None yet
Development

No branches or pull requests

4 participants