Skip to content

Avoid using StringTable for runtime data.#1974

Merged
istio-merge-robot merged 4 commits intoistio:masterfrom
ozevren:string-table
Dec 6, 2017
Merged

Avoid using StringTable for runtime data.#1974
istio-merge-robot merged 4 commits intoistio:masterfrom
ozevren:string-table

Conversation

@ozevren
Copy link
Copy Markdown
Contributor

@ozevren ozevren commented Dec 4, 2017

What this PR does / why we need it:
This fixes an issue in the evaluator that causes runtime strings to be captured in the strings table. With this fix:

  • The strings are stored in heap, similar to other interface{} objects.
  • The comparisons are performed using regular string comparison.
  • The size-based expression cache eviction algorithm (& its parameter) is removed.
  • Renamed the method on StringTable from GetID => Add for clarity.

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #
fixes #1369
Special notes for your reviewer:
This will most likely conflict with the pkg/server change. I'll wait until that one lands, before checking this in.

Release note:

Copy link
Copy Markdown
Contributor

@geeknoid geeknoid left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

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.

I really don't like "cacheSize" as a name since it's ambiguous between "size in bytes" and "size in entries". maxCacheEntries is usually a better choice for this kind of name IMO.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Noted. Hopefully, this will not survive very long, if I can land the CompiledExpression work soon.

@istio-merge-robot
Copy link
Copy Markdown

@ozevren PR needs rebase

@istio-merge-robot istio-merge-robot added needs-rebase Indicates a PR needs to be rebased before being merged PostSubmit Failed/Contact Oncall labels Dec 5, 2017
ozben added 3 commits December 6, 2017 09:04
…uation.

This fixes the tainting of the StringMap problem.
This ensures that the method would not be called from any execution level
context.
evaluator code.

This is not needed anymore with use of heap for storing strings during
evaluation.
@codecov
Copy link
Copy Markdown

codecov bot commented Dec 6, 2017

Codecov Report

Merging #1974 into master will increase coverage by 2.22%.
The diff coverage is 72.51%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1974      +/-   ##
==========================================
+ Coverage   79.81%   82.03%   +2.22%     
==========================================
  Files          75      202     +127     
  Lines        6890    16819    +9929     
==========================================
+ Hits         5499    13798    +8299     
- Misses       1104     2530    +1426     
- Partials      287      491     +204
Flag Coverage Δ
#broker 46.09% <ø> (-1.18%) ⬇️
#mixer 83.52% <72.51%> (?)
#pilot 80.81% <ø> (+0.09%) ⬆️
#security 92.03% <ø> (+3.2%) ⬆️
Impacted Files Coverage Δ
mixer/pkg/il/interpreter/interpreter.go 100% <ø> (ø)
mixer/cmd/server/cmd/server.go 0% <0%> (ø)
mixer/pkg/il/interpreter/extern.go 96.8% <100%> (ø)
mixer/pkg/il/strings.go 100% <100%> (ø)
mixer/pkg/il/program.go 100% <100%> (ø)
mixer/pkg/il/evaluator/evaluator.go 84.88% <100%> (ø)
mixer/pkg/il/text/read.go 94.47% <100%> (ø)
mixer/pkg/il/builder.go 100% <100%> (ø)
mixer/pkg/il/interpreter/interpreterRun.go 95.47% <69.91%> (ø)
pilot/adapter/config/memory/monitor.go 81.25% <0%> (-9.38%) ⬇️
... and 144 more

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 704d5cc...ca3aa5d. Read the comment docs.

@istio-merge-robot
Copy link
Copy Markdown

/lgtm cancel //PR changed after LGTM, removing LGTM. @geeknoid @ozevren

@istio-merge-robot istio-merge-robot removed lgtm needs-rebase Indicates a PR needs to be rebased before being merged labels Dec 6, 2017
@ozevren
Copy link
Copy Markdown
Contributor Author

ozevren commented Dec 6, 2017

Had to rebase. Can I get another /lgtm ?

@geeknoid
Copy link
Copy Markdown
Contributor

geeknoid commented Dec 6, 2017

/lgtm
/approve

@istio-merge-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: geeknoid

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@istio-merge-robot
Copy link
Copy Markdown

/test all [submit-queue is verifying that this PR is safe to merge]

@istio-merge-robot
Copy link
Copy Markdown

/test all [submit-queue is verifying that this PR is safe to merge]

@ozevren
Copy link
Copy Markdown
Contributor Author

ozevren commented Dec 6, 2017

/test istio-pilot-e2e

@istio-merge-robot
Copy link
Copy Markdown

/test all [submit-queue is verifying that this PR is safe to merge]

@istio-merge-robot
Copy link
Copy Markdown

Automatic merge from submit-queue.

@istio-merge-robot istio-merge-robot merged commit 4308f8f into istio:master Dec 6, 2017
@ozevren ozevren deleted the string-table branch December 7, 2017 00:14
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.

Add a script to query pilot for proxy configurations

5 participants