Postgresql ADF Postgres超时
我正在与ADF和Azure管理的Postgres合作。我遇到了一个反复出现的问题,查找和查询源复制活动在大约35秒后超时Postgresql ADF Postgres超时,postgresql,azure-data-factory,azure-data-factory-2,azure-postgresql,Postgresql,Azure Data Factory,Azure Data Factory 2,Azure Postgresql,我正在与ADF和Azure管理的Postgres合作。我遇到了一个反复出现的问题,查找和查询源复制活动在大约35秒后超时 Failure happened on 'Source' side. 'Type=Npgsql.NpgsqlException,Message=Exception while reading from stream,Source=Npgsql,''Type=System.IO.IOException,Message=Unable to read data from the t
Failure happened on 'Source' side. 'Type=Npgsql.NpgsqlException,Message=Exception while reading from stream,Source=Npgsql,''Type=System.IO.IOException,Message=Unable to read data from the transport connection: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.,Source=System,''Type=System.Net.Sockets.SocketException,Message=A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond,Source=System,'
因此,错误表明这是Npgsql异常,因此我查看了他们的文档,并修改了连接字符串,使其采用Timeout=60和CommandTimeout=60(内部超时默认为CommandTimeout)
而查询仍会超时约35秒。这可能是Azure托管实例的套接字问题导致超时,并且它正在向下传播到npgsql吗
任何帮助都将不胜感激 我添加了Leon建议的两个参数,解决了我的问题
我只是想增加一些精确度,因为我也遇到了同样的问题(感谢@DeliciousMalware和@Leon_Yue):
- 使用postgres连接的请求的默认超时时间为30秒
- 无法直接从查找活动更改此超时
- 唯一的选择是添加
链接到链接服务中的连接字符串(例如,如果使用密钥库),或在链接服务中添加选项附加参数,如@DeliciousMalware屏幕截图Timeout=600;CommandTimeout=0
用于建立连接,Timeout
是命令本身的超时时间(秒,CommandTimeout
表示无限大)0
- 连接背后的库是npgsql,其他可用的参数和详细信息也在其中:
我很难找到连接字符串的参数是什么,它们的含义是什么,以及存在哪一个,所以我很高兴找到这个文档。我在azure中的postgres上没有找到太多文档,因此我认为这个参数列表对其他人会有一些用处。你能尝试将连接字符串Timeout和CommandTimeout修改为更大的值吗?我也尝试过设置Timeout=600和CommandTimeout=0(这是无限的),但问题仍然存在。是否有可能取消是从postgres到npgsql的?有点像超控?