ADF-Postgres 超时

ADF-Postgres Timeout

我正在使用 ADF 和 Azure Managed 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 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 建议的 2 个参数并解决了我遇到的问题。

这是添加到链接服务的参数的屏幕截图:

这里是错误截图并完成运行:

这里是错误截图并完成运行:

我只是想增加一些精确度,因为我遇到了同样的问题(感谢@DeliciousMalware 和@Leon_Yue):

  • 使用 postgres 连接的请求默认超时为 30 秒
  • 无法通过查找 activity 直接更改此超时。
  • 做某事的唯一选择是将 Timeout=600;CommandTimeout=0; 添加到链接服务中的连接字符串(例如,如果您使用密钥保管库)或在链接服务附加参数中添加选项,如 @ DeliciousMalware 屏幕截图。
  • Timeout是建立连接,CommandTimeout是命令本身的超时时间(以秒为单位,0表示无穷大)
  • 连接背后的库是npgsql,其他可用的参数和细节在那里:https://www.npgsql.org/doc/connection-string-parameters.html

我费了好大劲才找到连接字符串的参数是什么,它们是什么意思,以及哪一个存在,所以我很高兴找到这个文档。我没有在 azure 中找到很多关于 postgres 的文档,所以我认为这个参数列表对其他人会有一些用处。