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

[classlib] increase maxAttempts for tcp connection to the server #4481

Merged

Conversation

dyfer
Copy link
Member

@dyfer dyfer commented Jul 8, 2019

Purpose and Motivation

Tested on macOS 10.13.

In the process of testing #4435, I realized that supernova takes considerably more time to boot than scsynth, which is a problem with we wait for the tcp connection to be established.

NetAddr -tryConnectTCP, called by Server -boot by default makes a maximum of 10 attempts every 0.2s, and then says that the connection failed. That means that the server needs to respond within 2 seconds.
On my system supernova takes about 1.8s to respond to the tcp connection (~8 connection attempts) when the system is idle. When I stress my system, the server often boots after we run out of connection attempts (supernova responds after more than 2 seconds).

This PR increases number of connection attempts to 20, in practice giving server 4 seconds to respond. It is a workaround (not a fix) for #4483.

Types of changes

  • Bug fix

To-do list

  • Code is tested
  • This PR is ready for review

Copy link
Contributor

@mossheim mossheim left a comment

Choose a reason for hiding this comment

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

Thanks!

I would rather see your explanation for this change in a comment in the code and/or in the commit message, so that it's preserved in the codebase.

On my system supernova takes about 1.8s to respond to the tcp connection (~8 connection attempts) when the system is idle. When I stress my system, the server often boots after we run out of connection attempts (supernova responds after more than 2 seconds).

Is this in a release or debug build?

SCClassLibrary/Common/Control/Server.sc Outdated Show resolved Hide resolved
@dyfer
Copy link
Member Author

dyfer commented Jul 16, 2019

Is this in a release or debug build?

Release or RelWithDebInfo. The performance is similar for my own build as it is for official 3.10.2.

@dyfer dyfer force-pushed the topic/server-connection-attempts branch 2 times, most recently from 6defa47 to e02a004 Compare September 9, 2019 23:15
@dyfer dyfer force-pushed the topic/server-connection-attempts branch from e02a004 to cc5d033 Compare September 9, 2019 23:17
@dyfer
Copy link
Member Author

dyfer commented Sep 9, 2019

I would rather see your explanation for this change in a comment in the code and/or in the commit message, so that it's preserved in the codebase.

I've added the comment in the code, is this OK?

Copy link
Contributor

@mossheim mossheim left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@joshpar joshpar self-requested a review September 22, 2019 20:14
@mossheim
Copy link
Contributor

@joshpar are you planning to review this anytime soon?

@mossheim mossheim merged commit 68bb013 into supercollider:develop Jan 5, 2020
@mossheim mossheim removed the request for review from joshpar January 5, 2020 02:42
@mossheim
Copy link
Contributor

mossheim commented Jan 5, 2020

@joshpar feel free to look this over if you're still interested

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