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

业务高峰时段数据库操作报异常System.AggregateException: One or more errors occurred. (Name or service not known) #1795

Open
renxuefeng opened this issue Apr 26, 2024 · 3 comments

Comments

@renxuefeng
Copy link

问题描述:

UseAdoConnectionPool(false)时报
企业微信截图_0baff53d-45fd-4ce1-a4aa-614dee650a1d

UseAdoConnectionPool(true)时报
image

看着像是获取不到数据库连接了,但查询阿里云SQL server时连接数并不高,100左右
连接字符串里尝试配置了
企业微信截图_7c2f8850-b581-4615-a803-b531e93fb9d9
无效果问题依然存在,异常基本都出现在业务高峰时段

数据库版本

阿里云RDS SQL Server 2016 标准版

安装的Nuget包

3.2.815

.net framework/. net core? 及具体版本

.netcore 6.0

@2881099
Copy link
Collaborator

2881099 commented Apr 26, 2024

你现在已经把问题矛头,放在FreeSql上面了。

提示已经很明显了,检查网络情况。特别是在报错的时候,你应该在程序中启动一份代码,用原生ado.net访问数据库测试的代码。

@renxuefeng
Copy link
Author

renxuefeng commented Apr 30, 2024

@2881099 你好,都是在获取池子里连接的时候报异常
System.OperationCanceledException: The operation was canceled. at Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) at Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
at Microsoft.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) at Microsoft.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 retry, DbConnectionOptions userOptions)
at Microsoft.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource1 retry, SqlConnectionOverrides overrides) at Microsoft.Data.SqlClient.SqlConnection.InternalOpenAsync(CancellationToken cancellationToken) --- End of stack trace from previous location --- at FreeSql.Internal.CommonProvider.DbConnectionStringPool.GetAsync() at FreeSql.Internal.CommonProvider.AdoProvider.ExecuteReaderMultipleAsync(Int32 multipleResult, DbConnection connection, DbTransaction transaction, Func3 fetchHandler, Action2 schemaHandler, CommandType cmdType, String cmdText, Int32 cmdTimeout, DbParameter[] cmdParms, CancellationToken cancellationToken)

业务请求量大的时候会出现,请问要加测试代码加在哪里?

@2881099
Copy link
Collaborator

2881099 commented Apr 30, 2024

提示操作被取消了,检查程序逻辑执行顺序。

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

No branches or pull requests

2 participants