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

Remove blocking calls in metrics framework #788

Merged
merged 49 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from 44 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
a293e1f
updating performance test to 1s
oliveromahony Aug 6, 2024
7d052b5
reopen file leak detected
oliveromahony Aug 6, 2024
c2658d1
reopen file leak detected
oliveromahony Aug 6, 2024
31a91ad
leak test
oliveromahony Aug 6, 2024
a44026f
leak test
oliveromahony Aug 6, 2024
f27ac62
debug instrumentation
oliveromahony Aug 7, 2024
8e6f766
debug instrumentation
oliveromahony Aug 7, 2024
9f98b78
wip: memory leaks
oliveromahony Aug 7, 2024
bdaf0c9
wip: fixing race conditions
oliveromahony Aug 7, 2024
883ced4
wip: race conditions
oliveromahony Aug 7, 2024
18a414b
wip: local changes
oliveromahony Aug 7, 2024
7d7ea6e
updated test
oliveromahony Aug 8, 2024
4c26c19
removed some memory leaks
oliveromahony Aug 9, 2024
ac5c7e0
local changes
oliveromahony Aug 9, 2024
c3edeea
remove wg
oliveromahony Aug 9, 2024
53bf44e
wip: remove wg
oliveromahony Aug 12, 2024
1b8e4d5
wip: failing tests
oliveromahony Aug 12, 2024
a5a2270
wip: failing tests
oliveromahony Aug 12, 2024
1f8cc5a
wip: buffer changes
oliveromahony Aug 14, 2024
336347f
wip: buffer changes
oliveromahony Aug 14, 2024
83920de
stuff
dhurley Aug 14, 2024
2cee3cc
removed wait group, fixed tests
oliveromahony Aug 15, 2024
b27d7ef
remove defer in main
oliveromahony Aug 15, 2024
2a97002
removed comment out code
oliveromahony Aug 15, 2024
0f28421
removed comment out code
oliveromahony Aug 15, 2024
b71c3f4
revert performance test
oliveromahony Aug 15, 2024
2499d45
fixed some stuff
oliveromahony Aug 15, 2024
03e410e
fixed unit tests
oliveromahony Aug 15, 2024
b67ed8b
testing int
oliveromahony Aug 15, 2024
dbfa9f2
fix some tests
oliveromahony Aug 15, 2024
731e47f
removed close from pipe
oliveromahony Aug 15, 2024
462ab19
fix comp test
oliveromahony Aug 15, 2024
798625b
updated agent api to handle new payload
oliveromahony Aug 15, 2024
2b19468
extend time of agent api tests
oliveromahony Aug 15, 2024
f576824
typo
oliveromahony Aug 15, 2024
4bad764
typo
oliveromahony Aug 15, 2024
7d01422
revert default config
oliveromahony Aug 16, 2024
41e9e8e
Fix metrics
dhurley Aug 19, 2024
b4bc2bc
Fix metrics
dhurley Aug 19, 2024
3fbcb39
merge
oliveromahony Aug 19, 2024
acb9d30
added tests
oliveromahony Aug 19, 2024
8c54e4a
remove debug statements
oliveromahony Aug 19, 2024
1c7ac98
remove unused import
oliveromahony Aug 19, 2024
9728145
updating performance test to 1s (#767)
oliveromahony Aug 22, 2024
de57d5e
remove info logging
oliveromahony Aug 22, 2024
29f0a09
code comments
oliveromahony Aug 26, 2024
628a25e
updated config
oliveromahony Aug 27, 2024
e6c68f4
code review comments
oliveromahony Aug 27, 2024
ca0ef5f
lint
oliveromahony Aug 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ require (
github.com/nginx/agent/sdk/v2 v2.30.3
github.com/prometheus/client_golang v1.19.1
github.com/rs/cors v1.11.0
go.uber.org/goleak v1.3.0
go.uber.org/mock v0.4.0
golang.org/x/sys v0.22.0
golang.org/x/sys v0.24.0
golang.org/x/text v0.16.0
gopkg.in/yaml.v2 v2.4.0
)
Expand Down
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE=
go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=
go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU=
go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc=
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
Expand Down Expand Up @@ -248,8 +250,8 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg=
golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
Expand Down
18 changes: 18 additions & 0 deletions leak_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* Copyright (c) F5, Inc.
*
* This source code is licensed under the Apache License, Version 2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

package main

import (
"testing"

"go.uber.org/goleak"
)

func TestMain(m *testing.M) {
goleak.VerifyTestMain(m)
}
14 changes: 4 additions & 10 deletions nginx-agent.conf
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,7 @@ metrics:
# path to aux file dirs can also be added
config_dirs: "/etc/nginx:/usr/local/etc/nginx:/usr/share/nginx/modules:/etc/nms"

# api:
oliveromahony marked this conversation as resolved.
Show resolved Hide resolved
# The port at which NGINX Agent accepts remote connections
# The API address and port allow for remote management of NGINX and NGINX Agent
#
# ~~~ WARNING ~~~
# Set API address to allow remote management
# host: 127.0.0.1
#
# Set this value to a secure port number to prevent information leaks.
# port: 8038
api:
dhurley marked this conversation as resolved.
Show resolved Hide resolved

host: 127.0.0.1
port: 8038
2 changes: 1 addition & 1 deletion sdk/backoff/backoff.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func WaitUntil(

expoBackoffWithContext := backoff.WithContext(exponentialBackoff, ctx)

err := backoff.Retry(backoff.Operation(operation), expoBackoffWithContext)
err := backoff.Retry(operation, expoBackoffWithContext)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion sdk/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ require (
golang.org/x/mod v0.19.0 // indirect
golang.org/x/net v0.27.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.22.0 // indirect
golang.org/x/sys v0.24.0 // indirect
golang.org/x/text v0.16.0 // indirect
golang.org/x/tools v0.23.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac // indirect
Expand Down
4 changes: 2 additions & 2 deletions sdk/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg=
golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
Expand Down
4 changes: 2 additions & 2 deletions sdk/vendor/golang.org/x/sys/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions sdk/vendor/golang.org/x/sys/unix/mkerrors.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions sdk/vendor/golang.org/x/sys/unix/syscall_darwin.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions sdk/vendor/golang.org/x/sys/unix/syscall_linux.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions sdk/vendor/golang.org/x/sys/unix/syscall_openbsd.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions sdk/vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions sdk/vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 35 additions & 3 deletions sdk/vendor/golang.org/x/sys/unix/zerrors_linux.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions sdk/vendor/golang.org/x/sys/unix/zerrors_linux_386.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions sdk/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions sdk/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions sdk/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions sdk/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions sdk/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions sdk/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions sdk/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions sdk/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions sdk/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions sdk/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions sdk/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions sdk/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions sdk/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading