-
Notifications
You must be signed in to change notification settings - Fork 345
Changing Permit redirection #1499
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
Changes from 1 commit
3ea4d86
4e58e42
e7b1fc7
6814615
17643e7
1a30a18
c8a0b63
6d93fa8
72527c7
6204285
cf08470
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -628,6 +628,8 @@ public override string ConnectionString | |||||
} | ||||||
} | ||||||
|
||||||
public string? SessionConnectionString => m_session?.ConnectionString; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this just for tests? We shouldn't add a new public property just to make testing easier; that will imply a commitment to support this. |
||||||
|
||||||
public override string Database => m_session?.DatabaseOverride ?? GetConnectionSettings().Database; | ||||||
|
||||||
public override ConnectionState State => m_connectionState; | ||||||
|
@@ -1062,22 +1064,9 @@ private async ValueTask<ServerSession> CreateSessionAsync(ConnectionPool? pool, | |||||
// only "fail over" and "random" load balancers supported without connection pooling | ||||||
var loadBalancer = connectionSettings.LoadBalance == MySqlLoadBalance.Random && connectionSettings.HostNames!.Count > 1 ? | ||||||
RandomLoadBalancer.Instance : FailOverLoadBalancer.Instance; | ||||||
|
||||||
var session = new ServerSession(m_logger) | ||||||
{ | ||||||
OwningConnection = new WeakReference<MySqlConnection>(this), | ||||||
}; | ||||||
Log.CreatedNonPooledSession(m_logger, session.Id); | ||||||
try | ||||||
{ | ||||||
_ = await session.ConnectAsync(connectionSettings, this, startingTimestamp, loadBalancer, activity, actualIOBehavior, connectToken).ConfigureAwait(false); | ||||||
return session; | ||||||
} | ||||||
catch (Exception) | ||||||
{ | ||||||
await session.DisposeAsync(actualIOBehavior, default).ConfigureAwait(false); | ||||||
throw; | ||||||
} | ||||||
var session = await ServerSession.ConnectAndRedirectAsync(() => new ServerSession(m_logger), m_logger, null, connectionSettings, loadBalancer, this, null, startingTimestamp, null, actualIOBehavior, cancellationToken).ConfigureAwait(false); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
See line 1073 below. |
||||||
session.OwningConnection = new WeakReference<MySqlConnection>(this); | ||||||
return session; | ||||||
} | ||||||
} | ||||||
catch (OperationCanceledException) when (timeoutSource?.IsCancellationRequested is true) | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The log field names are significant, and are used for "structured logging" within Microsoft.Extensions.Logging; see https://learn.microsoft.com/en-us/aspnet/core/fundamentals/logging/?view=aspnetcore-8.0#log-message-template.
We can't just change them for better code reuse (thinking of them like string concatenation).