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

KTOR-7777 Release proper InetSocketAddress #4482

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

divinae
Copy link

@divinae divinae commented Nov 15, 2024

Subsystem
Client

Motivation
We encountered a lot of crashes after updating to the Ktor v3 with the root causes:
Caused by: java.lang.IllegalStateException: The number of released permits cannot be greater than 100

The problem is that we request 4 calls to the same endpoint asynchronously. However, InetSocketAddress(host, port) could have different results (IP address could change) - the current solution stores only the last address.

Solution
Store InetSocketAddress separately per connect request.

@osipxd osipxd self-requested a review November 15, 2024 13:56
Copy link
Member

@osipxd osipxd left a comment

Choose a reason for hiding this comment

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

Thank you for the fix! I've created an issue not to miss this change from release notes:

  • KTOR-7777 Connections aren't released properly if there are multiple parallel connections to the same address

Do you think you can write tests covering this issue?

@osipxd osipxd changed the title Release proper InetSocketAddress KTOR-7777 Release proper InetSocketAddress Nov 15, 2024
@divinae
Copy link
Author

divinae commented Nov 15, 2024

Thank you for the fix! I've created an issue not to miss this change from release notes:

  • KTOR-7777 Connections aren't released properly if there are multiple parallel connections to the same address

Do you think you can write tests covering this issue?

I could try on Monday.

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.

2 participants