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

Fix solaris unit tests #19

Closed
wants to merge 2 commits into from
Closed

Fix solaris unit tests #19

wants to merge 2 commits into from

Conversation

jlsantiago0
Copy link

This resolves solaris unit tests failures caused by srt::CChannel::setUDPSockOpt() calling setsockopt() which can return failure when attempting to increase the SND|RCV buffers in excess of the system maximums. It seems that since Linux is the odd duck here, this should be the default implementation for all platforms?

This also makes sure that we dont try to reduce the size of the SND|RCV buffers as the default is >64k on Solaris and I think most BSD platforms. I assume reducing the size is not a good idea?

Biswa96 and others added 2 commits October 11, 2021 15:31
…uested size exceeds the system maximum value. Also do not reduce the buffer sizes.
@jlsantiago0
Copy link
Author

Before the PR:

The unit test hangs part way through.

solaris-test.log

@jlsantiago0
Copy link
Author

After the PR:

Unit tests run successfully.

solaris2-test.log

Comment on lines +269 to +271
socklen_t optSize;
int startRCVBUF = 0;
optSize = sizeof(startRCVBUF);
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
socklen_t optSize;
int startRCVBUF = 0;
optSize = sizeof(startRCVBUF);
int startRCVBUF = 0;
socklen_t optSize = sizeof startRCVBUF;

Comment on lines +294 to +298
if (0 != ::getsockopt(
m_iSocket, SOL_SOCKET, SO_RCVBUF, (void*)&currentRCVBUF, &optSize))
{
currentRCVBUF = -1;
}
Copy link
Owner

Choose a reason for hiding this comment

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

I think this duplicates line 272, doesn't it?

Copy link
Owner

Choose a reason for hiding this comment

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

And you no longer set the option to maxsize?

Copy link
Author

Choose a reason for hiding this comment

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

Well it may be changed, but return an error. For instance it seems on SunOS it sets to the max allowed system size, and then returns -1 if the requested size could not be set.

Which seems to be >64k, in which case we dont want to reduce the size back to 64k.

@jlsantiago0
Copy link
Author

A new PR submitted to Haivision#2162

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants