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

Optimizing Eventsource memory allocations and removing an extra comment. #684

Merged
merged 14 commits into from
Aug 21, 2020
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,11 @@ private static void DebugTraceKeyValuePair(string keyname, string keyvalue, Dict
// don't trace passwords ever!
if (null != keyvalue)
{
SqlClientEventSource.Log.AdvancedTraceEvent("<comm.DbConnectionOptions|INFO|ADV> KeyName='{0}', KeyValue='{1}'", keyname, keyvalue);
SqlClientEventSource.Log.AdvancedTraceEventExcluded("<comm.DbConnectionOptions|INFO|ADV> KeyName='{0}', KeyValue='{1}'", keyname, keyvalue);
}
else
{
SqlClientEventSource.Log.AdvancedTraceEvent("<comm.DbConnectionOptions|INFO|ADV> KeyName='{0}'", keyname);
SqlClientEventSource.Log.AdvancedTraceEventExcluded("<comm.DbConnectionOptions|INFO|ADV> KeyName='{0}'", keyname);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ private DbConnectionInternal CreateObject(DbConnection owningObject, DbConnectio
}
}
}
SqlClientEventSource.Log.PoolerTraceEvent("<prov.DbConnectionPool.CreateObject|RES|CPOOL> {0}, Connection {1}, Added to pool.", ObjectID, newObj != null ? newObj?.ObjectID.ToString() ?? "null" : "null");
SqlClientEventSource.Log.PoolerTraceEvent("<prov.DbConnectionPool.CreateObject|RES|CPOOL> {0}, Connection {1}, Added to pool.", ObjectID, newObj != null ? newObj?.ObjectID ?? 0 : -1);
DavoudEshtehari marked this conversation as resolved.
Show resolved Hide resolved

// Reset the error wait:
_errorWait = ERROR_WAIT_DEFAULT;
Expand Down Expand Up @@ -1287,7 +1287,7 @@ private bool TryGetConnection(DbConnection owningObject, uint waitForMultipleObj
}

// Do not use this pooled connection if access token is about to expire soon before we can connect.
if(null != obj && obj.IsAccessTokenExpired)
if (null != obj && obj.IsAccessTokenExpired)
{
DestroyObject(obj);
obj = null;
Expand Down
Loading