Google Cloud Functions & Redis: ECONNRESET

泪湿孤枕 提交于 2019-12-24 18:55:38

问题


Does anyone know why I continually get this error from cloud functions (google cloud functions) when using ioredis module?

[ioredis] Unhandled error event: Error: read ECONNRESET at _errnoException (util.js:1022:11) at TLSWrap.onread (net.js:628:25)

error log sample The error never stops. It doesn't affect normal operation (meaning, I can perform all desired operaitons just fine with ioredis module & my redis). Its incredibly obnoxious and makes it impossible to debug cloud function performance.

Notes: Using redis cache on Microsoft Azure (though I've tried self-managed redis on google compute as well), premium tier.

I suspect this must have something to do with how I am instantiating the redis/importing it. I am using it in only one file, utils/index.ts, and am intantiating it like so:

const redis = new Redis(6380, 'myredis.redis.cache.windows.net', { tls: true as any, password: 'azuresucks=' });

I've tried no-TLS, creating new caches, and pretty much everything else I can think of. Anyone with insight into ioredis and its compatibility with cloud functions, please help!m Note: I actually have tried using node_redis vs. ioredis- still having this issue.

Edit: Full Sample code from utils/index.ts https://gist.github.com/nicoandmee/c38d2b014b4377a4f386a0a0ae9a85e5 And here is my `index.ts' which is my entry point (where I am exporting the actual firebase functions). https://gist.github.com/nicoandmee/6e1d7d319effa1f23141b7148e3459c7

Here's an example of what I mean when I say it doesn't affect normal operation. Here my function executed successfully, but the error is still popping up constantly, seconds after. My code runs fine, but I can barely tell because of all this spam from the ECONNRESET being thrown. Maybe there is a way to just suppress this error / handle it? Because its not affecting my code otherwise. example 2

来源:https://stackoverflow.com/questions/53758506/google-cloud-functions-redis-econnreset

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!