当订阅队列大于可用实例时,预期行为是传递将失败并稍后重试。
似乎正在发生的事情是日志中充满了这样的消息:
{
"textPayload": "The request was aborted because there was no available instance.",
"insertId": "6109fbbb0007ec4aaa3855a9",
...
}
Run Code Online (Sandbox Code Playgroud)
并且订阅消息只是被丢弃而不会重试。
这是预期的行为吗?对我来说这似乎很疯狂,但如果是这样,您应该采用什么架构来捕获这些丢失的消息?
编辑:这些问题于 2021 年 7 月 5 日开始出现在我们的日志中,并且在该日期之前无法在日志中找到。在此之前,pubsub/gcf 组合曾经按预期工作。
google-cloud-platform google-cloud-pubsub google-cloud-functions
尝试从本地文件系统加载 PDF 并收到“未授权”错误。
“文件“/env/local/lib/python3.7/site-packages/wand/image.py”,第 4896 行,在读取 self.raise_exception() 文件“/env/local/lib/python3.7/site- package/wand/resource.py", line 222, in raise_exception raise e wand.exceptions.PolicyError: 未授权`/tmp/tmp_iq12nws'@error/constitute.c/ReadImage/412
PDF 文件已从 GCS 成功保存到本地“服务器”,但 Wand 不会加载。将图像加载到 OpenCV 中不是问题,只是在尝试使用 Wand/ImageMagick 加载 PDF 时发生
将 PDF 从 GCS 加载到本地文件系统到 Wand/ImageMagick 的代码如下
_, temp_local_filename = tempfile.mkstemp()
gcs_blob = STORAGE_CLIENT.bucket('XXXX').get_blob(results["storedLocation"])
gcs_blob.download_to_filename(temp_local_filename)
# load the pdf into a set of images using imagemagick
with(Image(filename=temp_local_filename, resolution=200)) as source:
#run through pages and save images etc.
Run Code Online (Sandbox Code Playgroud)
ImageMagick 应该被授权访问本地文件系统上的文件,因此它应该加载文件而不是这个“未授权”错误。