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

Add support for aliases on netcore+Windows #1588

Merged
merged 11 commits into from
Jun 9, 2022

Conversation

David-Engel
Copy link
Contributor

This brings support for aliases on netcore+Windows. It also merges TdsParserStaticMethods.cs into common code.

Functionally, this should bring alias support to netcore and netstandard when running on Windows.

@@ -1102,20 +1102,6 @@ internal PoolBlockingPeriod ConvertValueToPoolBlockingPeriod()
}
}

#if NETFRAMEWORK
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This diff is a bit misleading. This "deleted" section simply moved down and the NetLib code moved up so that the NetLib code is available on netcore.

}

private const int NoProcessId = -1;
private static int s_currentProcessId = NoProcessId;
internal static int GetCurrentProcessIdForTdsLoginOnly()
Copy link
Contributor Author

@David-Engel David-Engel Apr 19, 2022

Choose a reason for hiding this comment

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

I chose the netcore implementation of GetCurrentProcessIdForTdsLoginOnly over the netfx one that relied on the native method. I don't believe it will cause any noticeable behavior differences on netfx.

[ResourceConsumption(ResourceScope.Process, ResourceScope.Process)]
static internal Int32 GetCurrentThreadIdForTdsLoginOnly()

internal static int GetCurrentThreadIdForTdsLoginOnly()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I chose the netcore implementation of GetCurrentThreadIdForTdsLoginOnly over the netfx one that relied on the deprecated method. I don't believe it will cause any noticeable behavior differences on netfx.


object temp = ADP.LocalMachineRegistryValue(folder, localKey);
if (temp is int)
if (s_nicAddress != null)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I chose a merger of the netfx and netcore implementations of GetNetworkPhysicalAddressForTdsLoginOnly. Netcore had the optimization of caching s_nicAddress but did not have the registry lookup when running on Windows. Since this introduces registry lookups when on Windows, we can bring that functionality to netcore since users generally expect behavior parity when migrating from netfx to netcore.

@David-Engel David-Engel marked this pull request as ready for review April 19, 2022 22:37
Copy link
Contributor

@DavoudEshtehari DavoudEshtehari left a comment

Choose a reason for hiding this comment

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

All the test runs were skipped because the CanCreateAliases didn't return true.

@DavoudEshtehari DavoudEshtehari added this to the 5.0.0-preview3 milestone May 20, 2022
@David-Engel David-Engel requested review from DavoudEshtehari and removed request for johnnypham May 27, 2022 21:55
@codecov
Copy link

codecov bot commented May 28, 2022

Codecov Report

Merging #1588 (f138c0d) into main (845902c) will decrease coverage by 0.01%.
The diff coverage is 91.22%.

@@            Coverage Diff             @@
##             main    #1588      +/-   ##
==========================================
- Coverage   70.00%   69.99%   -0.02%     
==========================================
  Files         327      327              
  Lines       64594    64561      -33     
==========================================
- Hits        45218    45188      -30     
+ Misses      19376    19373       -3     
Flag Coverage Δ
addons 92.38% <ø> (ø)
netcore 72.27% <90.38%> (-0.09%) ⬇️
netfx 69.15% <76.59%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...SqlClient/src/Microsoft/Data/Common/AdapterUtil.cs 67.45% <ø> (+0.01%) ⬆️
...t/src/Microsoft/Data/Common/AdapterUtil.Windows.cs 66.66% <66.66%> (ø)
...crosoft/Data/SqlClient/SqlInternalConnectionTds.cs 73.26% <90.00%> (-0.39%) ⬇️
...Microsoft/Data/SqlClient/TdsParserStaticMethods.cs 73.33% <96.87%> (ø)
...Data/SqlClient/SqlClientMetaDataCollectionNames.cs 100.00% <100.00%> (ø)
...rc/Microsoft/Data/SqlClient/SqlConnectionString.cs 72.54% <100.00%> (ø)
...ActiveDirectoryAuthenticationTimeoutRetryHelper.cs 56.81% <0.00%> (-6.82%) ⬇️
...rc/Microsoft/Data/SqlClient/SQLFallbackDNSCache.cs 90.62% <0.00%> (-6.25%) ⬇️
...nt/src/Microsoft/Data/ProviderBase/TimeoutTimer.cs 71.42% <0.00%> (-3.58%) ⬇️
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a46f612...f138c0d. Read the comment docs.

@David-Engel David-Engel merged commit 3082ae5 into dotnet:main Jun 9, 2022
@David-Engel David-Engel deleted the aliases branch June 9, 2022 20:17
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.

3 participants