4b7d5c61 Merge pull request #59 from weaveworks/57-fix-lint-properly
b7f0e692 Merge pull request #58 from weaveworks/fix-lint
794702c7 Pin version of shfmt
ab1b11de Fix lint
81d80f35 Merge pull request #55 from weaveworks/lint-tf
05ad5f27 Review feedback
4c0d0469 Use hclfmt to lint terraform.
fd875e27 Fix test wrt shellcheck
54ec2d92 Don't capitalise error messages
19d3b6e2 Merge pull request #49 from weaveworks/pin-shfmt
fea98f66 Go get from the vendor dir
1d867b06 Try and vendor a specific version of shfmt
76619c2d Merge pull request #48 from weaveworks/revert-41-user-tokens
4f96c519 Revert "Add experimental support for user tokens"
d00033fd Merge pull request #41 from weaveworks/user-tokens
245ed267 Merge pull request #47 from weaveworks/46-shfmt
c1d7815a Fix shfmt error
cb397466 Don't overright lint_result with 0 when shellcheck succeeds
8ab80e87 Merge pull request #45 from weaveworks/lint
83d5bd1f getting integration/config and test shellcheck-compliant
cff9ec36 Fix some shellcheck errors
7a843d6d run shellcheck as part of lint if it is installed
31552a0e removing spurious space from test
6ca7c5f0 Merge pull request #44 from weaveworks/shfmt
952356d8 Allow lint to lint itself
b7ac59c3 Run shfmt on all shell files in this repo
5570b0e9 Add shfmt formatting of shell files in lint
0a675941 fix circle build by splatting gopath permissions
354e0838 Fixing lint
586060b2 Add experimental support for user tokens
git-subtree-dir: tools
git-subtree-split: 4b7d5c617e662acb8b1bee4203d7671fb0aa1cba
The header checking code was unsafe because:
1. It was accessing the byteslice at [2] without ensuring a length >= 3
2. It was assuming that the indentation of the 'sl' header is always 2 (which seems to be the case in recent kernels 8f18e4d03e/net/ipv4/tcp_ipv4.c (L2304) and 8f18e4d03e/net/ipv6/tcp_ipv6.c (L1831) ) but it's more robust to simply trim the byteslice.
`extras/dialer` contains both a dialer script and dialer.go, the go
sources for the dialer server and client, to allow users to build the
dialer container themselves. Move dialer.go to a sub directory `src`
since `make clean` (running `go clean ./...`) deletes the dialer script
otherwise.
Fixup for 4d20a91a97
Signed-off-by: Michael Schubert <michael@kinvolk.io>
User can control the webserver listen address with `-app.http.address`.
If they do, `scope --mode probe ...` should use the port part of address
in the default target and not ':4040'. Otherwise we encounter a
`dial tcp 127.0.0.1:4040: getsockopt: connection refused` error and
`scope-probe` cannot report.
Signed-off-by: Michael Schubert <michael@kinvolk.io>
- describeServices wasn't describing the partial page left over at the end,
which would cause incorrect results
- the shim between listServices and describeServices was closing the channel every iteration,
which would cause panic for write to closed channel
- client was not being saved when created, so it gets recreated each time
- we were describeTasks'ing even if we had no tasks to describe
Due to AWS API rate limits, we need to minimize API calls as much as possible.
Our stated objectives:
* for all displayed tasks and services to have up-to-date metadata
* for all tasks to map to services if able
My approach here:
* Tasks only contain immutable fields (that we care about). We cache tasks forever.
We only DescribeTasks the first time we see a new task.
* We attempt to match tasks to services with what info we have. Any "referenced" services,
ie. a service with at least one matching task, needs to be updated to refresh changing data.
* In the event that a task doesn't match any of the (updated) services, ie. a new service entirely
needs to be found, we do a full list and detail of all services (we don't re-detail ones we just refreshed).
* To avoid unbounded memory usage, we evict tasks and services from the cache after 1 minute without use.
This should be long enough for things like temporary failures to be glossed over.
This gives us exactly one call per task, and one call per referenced service per report,
which is unavoidable to maintain fresh data. Expensive "describe all" service queries are kept
to only when newly-referenced services appear, which should be rare.
We could make a few very minor improvements here, such as trying to refresh unreferenced but known
services before doing a list query, or getting details one by one when "describing all" and stopping
when all matches have been found, but I believe these would produce very minor, if any, gains in
number of calls while having an unjustifiable effect on latency since we wouldn't be able to do requests
as concurrently.
Speaking of which, this change has a minor performance impact.
Even though we're now doing less calls, we can't do them as concurrently.
Old code:
concurrently:
describe tasks (1 call)
sequentially:
list services (1 call)
describe services (N calls concurrently)
Assuming full concurrency, total latency: 2 end-to-end calls
New code (worst case):
sequentially:
describe tasks (1 call)
describe services (N calls concurrently)
list services (1 call)
describe services (N calls concurrently)
Assuming full concurrency, total latency: 4 end-to-end calls
In practical terms, I don't expect this to matter.