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 message order issue for management SDK #1801

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

Conversation

Y-Sindo
Copy link
Member

@Y-Sindo Y-Sindo commented Jun 26, 2023

No description provided.

var connectionUsed = await WriteWithRetry(serviceMessage, _inUseConnection, currentConnections, IterateConnectionsInFixedOrder);
// Similarly, here is currently no synchronization when persisting selected connection in _inUseConnection.

if (connectionUsed != _inUseConnection)
Copy link
Member

Choose a reason for hiding this comment

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

check+set is not atomic, maybe simply set

@@ -515,22 +516,21 @@ private async Task WriteToScopedOrRandomAvailableConnection(ServiceMessage servi
}
else
{
await WriteWithRetry(serviceMessage, null, currentConnections);
var connectionUsed = await WriteWithRetry(serviceMessage, _inUseConnection, currentConnections, IterateConnectionsInFixedOrder);
Copy link
Member

Choose a reason for hiding this comment

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

so it changes the current behavior that the traffic distributes to random connections for proxy mode. is using random connections enough?

}
}
iterator ??= iterateConnections(currentConnections).GetEnumerator();
connection = iterator.MoveNext() ? iterator.Current : throw new ServiceConnectionNotActiveException();
Copy link
Member

Choose a reason for hiding this comment

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

using do.. while(iterator.MoveNext()) pattern?

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.

None yet

2 participants