-
Notifications
You must be signed in to change notification settings - Fork 616
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
Consume TMDS init function from ecs-agent module #3663
Conversation
@@ -46,6 +45,7 @@ require ( | |||
github.com/containerd/continuity v0.3.0 // indirect | |||
github.com/coreos/go-systemd/v22 v22.3.2 // indirect | |||
github.com/davecgh/go-spew v1.1.1 // indirect | |||
github.com/didip/tollbooth v4.0.2+incompatible // indirect |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
General Question!: Why was github.com/didip/tollbooth v4.0.2+incompatible
moved here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was done by go mod tidy
. The reason is that agent
module no longer has a direct dependency on tollbooth
which is a library that provides request rate limiting middleware. ecs-agent
module is responsible for adding the rate limiting middleware to TMDS, so agent
module now has an indirect dependency on tollbooth
while ecs-agent
has a direct dependency as shown below.
amazon-ecs-agent/ecs-agent/go.mod
Line 8 in c83389c
github.com/didip/tollbooth v4.0.2+incompatible |
Could you also add a link to the previous PR in the description? |
Yes, added a link to the previous PR to the description. |
Summary
TMDS initialization was moved to
ecs-agent
module in #3660. Change TMDS initialization inagent
module to consume the TMDS initialization function fromecs-agent
module.Implementation details
tmds.NewServer
function fromecs-agent
module inagent/task_server_setup.go
file and use it to initialize TMDS.AgentCredentialsPort
constant withtmds.Port
constant imported fromecs-agent
module.LoggingHandler
in introspection server with aLoggingHandler
imported fromecs-agent
module.LoggingHandler
has also been moved toecs-agent
module. Remove theLoggingHandler
inagent
module.Testing
Unit and functional tests are already in place to test TMDS. In addition to those, I performed some manual tests that are listed below.
429 Too Many Requests
error when the limits are exceeded.taskWithTags
endpoint at a high request rate (for this endpoint) of 40rps to trigger throttling and checked that write timeout kicked in for the throttled requests and cut the connection after a timeout of 5 seconds as expected.New tests cover the changes: no
Description for the changelog
Consume TMDS init function from ecs-agent module
Licensing
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.