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

Release IP address on session stop #5970

Merged
merged 4 commits into from
Apr 30, 2024
Merged

Release IP address on session stop #5970

merged 4 commits into from
Apr 30, 2024

Conversation

Zensey
Copy link
Contributor

@Zensey Zensey commented Feb 13, 2024

Symptoms:

invalid config to consumer request with nil instead of ip address.
like this:
{"local_port":0,"remote_port":0,"ports":null,"provider":{"public_key":"iixI/brFnGk5JPADWVhzum2WltsMV2A8iabJKgJuWQo=","endpoint":"46.14.127.237:57757"},"consumer":{"ip_address":"\u003cnil\u003e","dns_ips":"\u003cnil\u003e"}}

Cause:
IP is allocated for consumer on session start, but never gets released. Given the limited size of IP pool, exhaustion can happen in a few days or hours.

@@ -188,6 +188,7 @@ func (m *Manager) ProvideConfig(sessionID string, sessionConfig json.RawMessage,
if err := conn.Stop(); err != nil {
log.Error().Err(err).Msg("Failed to stop connection endpoint")
}
conn.ReleaseIP(config.Consumer.IPAddress)
Copy link
Member

Choose a reason for hiding this comment

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

The same are done in the next line, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@Zensey Zensey force-pushed the fix/consumer-ip branch 2 times, most recently from 0621c05 to cbdc9dd Compare February 15, 2024 14:39
@codecov-commenter
Copy link

codecov-commenter commented Feb 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 37.97%. Comparing base (4a517cd) to head (483c458).
Report is 66 commits behind head on master.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5970      +/-   ##
==========================================
+ Coverage   37.90%   37.97%   +0.06%     
==========================================
  Files         371      371              
  Lines       20665    20715      +50     
==========================================
+ Hits         7833     7866      +33     
- Misses      12054    12064      +10     
- Partials      778      785       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Zensey Zensey requested a review from soffokl February 21, 2024 08:49
Copy link

stale bot commented Mar 10, 2024

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Mar 10, 2024
Copy link

stale bot commented Mar 30, 2024

This pull request has been automatically closed because it has not had activity for a long time. If this pull request is still valid, please ping a maintainer and ask them to label it as "pinned". Thank you for your contributions.

@stale stale bot closed this Mar 30, 2024
@Zensey Zensey added pinned prevents issue to be marked as stale and removed stale pinned prevents issue to be marked as stale labels Apr 30, 2024
@Zensey Zensey reopened this Apr 30, 2024
@Zensey Zensey force-pushed the fix/consumer-ip branch 2 times, most recently from 4dc87cb to d164333 Compare April 30, 2024 14:19
@Zensey Zensey force-pushed the fix/consumer-ip branch 2 times, most recently from 8f6c170 to be5e15b Compare April 30, 2024 14:41
Signed-off-by: Anton Litvinov <[email protected]>
@Zensey Zensey merged commit c97221a into master Apr 30, 2024
19 checks passed
@Zensey Zensey deleted the fix/consumer-ip branch April 30, 2024 15:17
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.

3 participants