Skip to content

Conversation

@kacpersaw
Copy link
Contributor

@kacpersaw kacpersaw commented Oct 31, 2025

This change updates how SMTP notifications are polled during scale tests.

Before, each of the ~2,000 pollers created its own http.Client, which opened thousands of short-lived TCP connections.
Under heavy load, this ran out of available network ports and caused errors like connect: cannot assign requested address

Now, all pollers share one HTTP connection pool. This prevents port exhaustion and makes polling faster and more stable.
If a network error happens, the poller will now retry instead of stopping, so tests keep running until all notifications are received.

The SMTPRequestTimeout is now applied per request using a context, instead of being set on the http.Client.

Copy link
Contributor Author

kacpersaw commented Oct 31, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@kacpersaw kacpersaw marked this pull request as ready for review October 31, 2025 10:52
smtpHTTPTransport := &http.Transport{
MaxConnsPerHost: 512,
MaxIdleConnsPerHost: 512,
MaxIdleConns: 2048,
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the purpose of setting both this and a per-host value?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That was left over from my earlier tests. I forgot that MaxIdleConns is unlimited by default, so MaxIdleConnsPerHost is enough. Fixed.

@kacpersaw kacpersaw force-pushed the kacpersaw/scaletest-notifications-smtp-tuning branch from bb67e96 to 188da9b Compare November 11, 2025 09:56
@github-actions github-actions bot added the stale This issue is like stale bread. label Nov 19, 2025
@github-actions github-actions bot closed this Nov 23, 2025
@spikecurtis spikecurtis reopened this Nov 24, 2025
@kacpersaw kacpersaw merged commit 6d41bfa into main Nov 24, 2025
31 checks passed
@kacpersaw kacpersaw deleted the kacpersaw/scaletest-notifications-smtp-tuning branch November 24, 2025 13:25
@github-actions github-actions bot locked and limited conversation to collaborators Nov 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

stale This issue is like stale bread.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants