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

Add common blocking implementation details to docs #5358

Merged
merged 7 commits into from
Feb 21, 2019
Merged

Conversation

banks
Copy link
Member

@banks banks commented Feb 19, 2019

These come up over and over again with blocking query loops in our own code and third-party's. #5333 is possibly a case (unconfirmed) where "badly behaved" blocking clients cause issues, however since we've never explicitly documented these things it's not reasonable for third-party clients to have guessed that they are needed!

This hopefully gives us something to point to for the future.

It's a little wordy - happy to consider breaking some of the blocking stuff out of this page if we think it's appropriate but just wanted to quickly plaster over this gap in our docs for now.

These come up over and over again with blocking query loops in our own code and third-party's. #5333 is possibly a case (unconfirmed) where "badly behaved" blocking clients cause issues, however since we've never explicitly documented these things it's not reasonable for third-party clients to have guessed that they are needed!

This hopefully gives us something to point to for the future.

It's a little wordy - happy to consider breaking some of the blocking stuff out of this page if we think it's appropriate but just wanted to quickly plaster over this gap in our docs for now.
@banks banks requested a review from a team February 19, 2019 11:25
Copy link
Member

@mkeeler mkeeler left a comment

Choose a reason for hiding this comment

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

This looks great.

Copy link
Member

@lkysow lkysow left a comment

Choose a reason for hiding this comment

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

Is it possible to link to consul-template code that has implemented our recommendations?

website/source/api/index.html.md Outdated Show resolved Hide resolved
website/source/api/index.html.md Outdated Show resolved Hide resolved
@kaitlincart kaitlincart added the type/docs Documentation needs to be created/updated/clarified label Feb 19, 2019
Co-Authored-By: banks <banks@banksco.de>
@banks
Copy link
Member Author

banks commented Feb 19, 2019

Is it possible to link to consul-template code that has implemented our recommendations?

@lkysow I did consider that. The consul built in watch package is actually the most correct example but it's also not super easy to read because it has a few abstractions in the way. Consul template's implementation actually doesn't do all of the recommended things here and the ones it does are buried in a few places under some other abstractions!

We have a few more recently written blocking loops within Consul code that more closely follow this pattern and are a bit simpler to read but ultimately it seemed easier to just describe the ideal case.

@lkysow
Copy link
Member

lkysow commented Feb 19, 2019

Is it possible to link to consul-template code that has implemented our recommendations?

@lkysow I did consider that. The consul built in watch package is actually the most correct example but it's also not super easy to read because it has a few abstractions in the way. Consul template's implementation actually doesn't do all of the recommended things here and the ones it does are buried in a few places under some other abstractions!

We have a few more recently written blocking loops within Consul code that more closely follow this pattern and are a bit simpler to read but ultimately it seemed easier to just describe the ideal case.

👍

@banks
Copy link
Member Author

banks commented Feb 20, 2019

@kaitlincarter-hc done, do you think this is good to merge and release? Feel free if you have time otherwise I'll get to it.

@kaitlincart kaitlincart merged commit 360e3ac into master Feb 21, 2019
@kaitlincart kaitlincart deleted the blocking-docs branch February 21, 2019 21:34
kaitlincart pushed a commit that referenced this pull request Feb 21, 2019
* Add common blocking implementation details to docs

These come up over and over again with blocking query loops in our own code and third-party's. #5333 is possibly a case (unconfirmed) where "badly behaved" blocking clients cause issues, however since we've never explicitly documented these things it's not reasonable for third-party clients to have guessed that they are needed!

This hopefully gives us something to point to for the future.

It's a little wordy - happy to consider breaking some of the blocking stuff out of this page if we think it's appropriate but just wanted to quickly plaster over this gap in our docs for now.

* Update index.html.md

* Apply suggestions from code review

Co-Authored-By: banks <banks@banksco.de>

* Update index.html.md

* Update index.html.md

* Clearified monotonically

* Fixing formating
johncowen pushed a commit that referenced this pull request Mar 11, 2019
More recommendations for blocking queries clients was added here:

#5358

This commit mainly adds cursor/index validation/correction based on
these recommendations (plus tests)

The recommendations also suggest that clients should include rate
limiting. Because of this, we've moved the throttling out of Consul UI
specific code and into Blocking Query specific code. Currently the 'rate
limiting' in this commit only adds a sleep to every iteration of the
loop, which is not the recommended approach, but the code here organizes
the throttling functionality into something we can work with later to
provide something more apt.
johncowen added a commit that referenced this pull request Mar 22, 2019
…5470)

More recommendations for blocking queries clients was added here:

#5358

This commit mainly adds cursor/index validation/correction based on
these recommendations (plus tests)

The recommendations also suggest that clients should include rate
limiting. Because of this, we've moved the throttling out of Consul UI
specific code and into Blocking Query specific code. Currently the 'rate
limiting' in this commit only adds a sleep to every iteration of the
loop, which is not the recommended approach, but the code here organizes
the throttling functionality into something we can work with later to
provide something more apt.
johncowen added a commit that referenced this pull request Apr 29, 2019
…5470)

More recommendations for blocking queries clients was added here:

#5358

This commit mainly adds cursor/index validation/correction based on
these recommendations (plus tests)

The recommendations also suggest that clients should include rate
limiting. Because of this, we've moved the throttling out of Consul UI
specific code and into Blocking Query specific code. Currently the 'rate
limiting' in this commit only adds a sleep to every iteration of the
loop, which is not the recommended approach, but the code here organizes
the throttling functionality into something we can work with later to
provide something more apt.
johncowen added a commit that referenced this pull request May 1, 2019
…5470)

More recommendations for blocking queries clients was added here:

#5358

This commit mainly adds cursor/index validation/correction based on
these recommendations (plus tests)

The recommendations also suggest that clients should include rate
limiting. Because of this, we've moved the throttling out of Consul UI
specific code and into Blocking Query specific code. Currently the 'rate
limiting' in this commit only adds a sleep to every iteration of the
loop, which is not the recommended approach, but the code here organizes
the throttling functionality into something we can work with later to
provide something more apt.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/docs Documentation needs to be created/updated/clarified
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants