Skip to content

Conversation

@mohith-kumar-thummaluru
Copy link

@mohith-kumar-thummaluru mohith-kumar-thummaluru commented Mar 12, 2024

The preset buffer length threshold of 1024 bytes falls short for AF_RDS sockets because each RDS connection has a minimum size of 92 bytes. This limitation restricts us to managing merely around 1024/92 ~ 11 connections. In practical terms, this is inadequate, considering there are machines that manage hundreds of connections.

This patch addresses the issue by initially setting the buflen argument to 0 when calling getsockopt(), which consequently returns the necessary buffer length. Subsequently, a buffer of the returned size is created for the next getsockopt() call, allowing us to retrieve the full buffer without being constrained by the threshold limit.

In addition, the existing implementation overlooks the return value from the kernel's getsockopt function. However, this return value is critical for decoding the buffer data emanating from the AF_RDS sockets. To address this, I propose a solution that involves appending the return value to the buffer specifically for AF_RDS sockets.

The preset buffer length threshold of 1024 bytes falls short for AF_RDS sockets because each RDS connection has a minimum size of 92 bytes. This limitation restricts us to managing merely around 1024/92 ~ 11 connections. In practical terms, this is inadequate, considering there are machines that manage hundreds of connections.

This patch addresses the issue by initially setting the buflen argument to 0 when calling getsockopt function, which consequently returns the necessary buffer length. Subsequently, a buffer of the returned size is created for the next getsockopt call, allowing us to retrieve the full buffer without being constrained by the threshold limit.

In addition, the existing implementation overlooks the return value from the kernel's getsockopt function. However, this return value is critical for decoding the buffer data emanating from the AF_RDS sockets. To address this, I propose a solution that involves appending the return value to the buffer specifically for AF_RDS sockets.

Signed-off-by: Mohith Kumar Thummaluru <mohith.k.kumar.thummaluru@oracle.com>
@ghost
Copy link

ghost commented Mar 12, 2024

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-app
Copy link

bedevere-app bot commented Mar 12, 2024

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@bedevere-app
Copy link

bedevere-app bot commented Mar 12, 2024

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@bedevere-app
Copy link

bedevere-app bot commented Mar 13, 2024

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

blurb-it bot and others added 5 commits March 15, 2024 08:12
The preset buffer length threshold of 1024 bytes falls short for AF_RDS sockets because each RDS connection has a minimum size of 92 bytes. This limitation restricts us to managing merely around 1024/92 ~ 11 connections. In practical terms, this is inadequate, considering there are machines that manage hundreds of connections.

This patch addresses the issue by initially setting the buflen argument to 0 when calling getsockopt function, which consequently returns the necessary buffer length. Subsequently, a buffer of the returned size is created for the next getsockopt call, allowing us to retrieve the full buffer without being constrained by the threshold limit.

In addition, the existing implementation overlooks the return value from the kernel's getsockopt function. However, this return value is critical for decoding the buffer data emanating from the AF_RDS sockets. To address this, I propose a solution that involves appending the return value to the buffer specifically for AF_RDS sockets.

Signed-off-by: Mohith Kumar Thummaluru <mohith.k.kumar.thummaluru@oracle.com>
@mohith-kumar-thummaluru
Copy link
Author

Hi,

Could you please let me know if there are any comments.

@mohith-kumar-thummaluru mohith-kumar-thummaluru changed the title gh-112740: AF_RDS support for getsockopt gh-112740: Removed buffer size limit for AF_RDS Jul 10, 2024
Copy link
Member

@ZeroIntensity ZeroIntensity left a comment

Choose a reason for hiding this comment

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

Some general formatting nitpicks -- it's good to go for PEP 7 compliance on new code.

mohith-kumar-thummaluru and others added 2 commits July 11, 2024 19:05
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
@ZeroIntensity
Copy link
Member

Not sure why CI is failing all of a sudden.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants