Skip to content

Make DiscoveryServer stream ID global - #157

Open
smtilden wants to merge 1 commit into
envoyproxy:mainfrom
smtilden:stilden/global-stream-counter
Open

Make DiscoveryServer stream ID global#157
smtilden wants to merge 1 commit into
envoyproxy:mainfrom
smtilden:stilden/global-stream-counter

Conversation

@smtilden

Copy link
Copy Markdown

No description provided.

@smtilden
smtildenforce-pushed the stilden/global-stream-counter branch from 2dddc8f to e8ea8baCompareDecember 16, 2020 20:45
@smtilden

Copy link
Copy Markdown
Author
When surfacing V2 and V3 streams alongside each other in envoy-control,
DiscoveryServerCallbacks are unable to differentiate between V2 & V3 ADS
upon onStreamClose(), onStreamCloseWithError().
This means that any DiscoveryServerCallback that keeps state cannot pivot
on stream IDs, since there will be duplicate between V2 & V3. This change
creates a global StreamCounter, which ensures stream IDs will be unique
across V2 & V3 streams.

When surfacing V2 and V3 streams alongside each other in envoy-control,
DiscoveryServerCallbacks are unable to differentiate between V2 & V3 ADS
upon onStreamClose(), onStreamCloseWithError().
This means that any DiscoveryServerCallback that keeps state cannot pivot
on stream IDs, since there will be duplicate between V2 & V3. This change
creates a global StreamCounter, which ensures stream IDs will be unique
across V2 & V3 streams.
Signed-off-by: Stephanie Tilden <stephanietilden@squareup.com>
@smtilden
smtildenforce-pushed the stilden/global-stream-counter branch from e8ea8ba to 91da9e9CompareDecember 16, 2020 20:47
@codecov-io

Copy link
Copy Markdown

Codecov Report

Merging #157 (91da9e9) into master (ff834cb) will decrease coverage by 0.07%.
The diff coverage is 75.00%.

Impacted file tree graph

@@ Coverage Diff @@## master #157 +/- ##
============================================
- Coverage 88.22% 88.15% -0.08% - Complexity 298 300 +2 
============================================
Files 31 32 +1 Lines 977 979 +2 Branches 78 78 ============================================
+ Hits 862 863 +1 - Misses 85 86 +1 
Partials 30 30 
Impacted FilesCoverage ΔComplexity Δ
.../envoyproxy/controlplane/server/StreamCounter.java66.66% <66.66%> (ø)2.00 <2.00> (?)
...nvoyproxy/controlplane/server/DiscoveryServer.java100.00% <100.00%> (ø)6.00 <3.00> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ff834cb...91da9e9. Read the comment docs.

final ConfigWatcher configWatcher;
final ProtoResourcesSerializer protoResourcesSerializer;
private final ExecutorGroup executorGroup;
private final AtomicLong streamCount = new AtomicLong();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you instead just make this field static?

Base automatically changed from master to mainJanuary 16, 2021 21:52

@baojrbaojr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We've been running this in production for a while without issue.

@jakubdyszkiewiczjakubdyszkiewicz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@slonka LGTM, can we merge it?

@slonka

Copy link
Copy Markdown
Member

I will look at it tomorrow, if you're in a hurry then go for it.

@slonka

Copy link
Copy Markdown
Member

@jakubdyszkiewicz do you want to release it or should I?

@mpuncel

Copy link
Copy Markdown
Contributor

@slonka looks like we should probably merge this? is your approval still good?

@slonka

Copy link
Copy Markdown
Member

@mpuncel - yeah 👍 - I just did not release it because the release process was broken at the time. If it's fixed then go ahead.

Sign up for freeto 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.

6 participants

@smtilden@codecov-io@slonka@mpuncel@baojr@jakubdyszkiewicz