AWS Lambda detection never matches because the environment variable name has a trailing space
维护者通常 6 天内回复
还没有人认领这个 Issue。
评估
调研方向
从 src/Exceptionless/Extensions/ExceptionlessConfigurationExtensions.cs 中的 ReadFromEnvironmentalVariables() 开始,检查 GetEnvironmentalVariable 查找逻辑。从 AWS Lambda 变量名中删除末尾空格,并为 AWS 和 Azure Functions 变量都添加测试。运行相关的配置测试;完成的标准是 AWS 变量默认启用 ProcessQueueOnCompletedRequest,与 Azure 的行为一致。
由索引模型根据 Issue 内容生成。
描述
In Exceptionless 6.2.0 (core Exceptionless package), ReadFromEnvironmentalVariables() is meant to turn on ProcessQueueOnCompletedRequest automatically when running in AWS Lambda, but it looks up "AWS_LAMBDA_FUNCTION_NAME " (with a trailing space). No such variable exists, so the Lambda check never fires.
Where
- https://github.com/exceptionless/Exceptionless.Net/blob/5792f00d175f94a35fe0559c8e9999234a8163be/src/Exceptionless/Extensions/ExceptionlessConfigurationExtensions.cs#L496-L506 (the check is on line 500)
- https://github.com/exceptionless/Exceptionless.Net/blob/5792f00d175f94a35fe0559c8e9999234a8163be/src/Exceptionless/Extensions/ExceptionlessConfigurationExtensions.cs#L518-L535 (
GetEnvironmentalVariabledoes an exact, untrimmed key lookup)
What happens
On AWS Lambda, AWS_LAMBDA_FUNCTION_NAME is set, but the lookup is for AWS_LAMBDA_FUNCTION_NAME , so it returns null. ProcessQueueOnCompletedRequest stays false unless the app sets it explicitly, and the ASP.NET Core middleware does not flush the queue at the end of each request. Lambda freezes the process after the response is sent, so queued events can sit unsent until a later invocation, or be lost when the environment is recycled (see #215 for the original report of this behavior). The Azure Functions check on the next line (FUNCTIONS_WORKER_RUNTIME) works because it has no trailing space.
Expected
When AWS_LAMBDA_FUNCTION_NAME is set and Exceptionless:ProcessQueueOnCompletedRequest is not configured, ProcessQueueOnCompletedRequest is set to true, the same as on Azure Functions.
Steps to reproduce
- Set the environment variable
AWS_LAMBDA_FUNCTION_NAME=testand do not setExceptionless__ProcessQueueOnCompletedRequest. - Create a client and call
client.Configuration.ReadFromEnvironmentalVariables()(orclient.Startup()). client.Configuration.ProcessQueueOnCompletedRequestisfalse. Repeat withFUNCTIONS_WORKER_RUNTIME=dotnetand it istrue.
Suggested fix
Remove the trailing space: GetEnvironmentalVariable("AWS_LAMBDA_FUNCTION_NAME"), and add a test that covers both serverless variables.
- 主要语言
- C#
- 星标
- 573
- 派生
- 143
- 平均合并
- 5 天 9 小时
- 30 天内合并 PR
- 1
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
exceptionless/Exceptionless.Net 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 86/100
exceptionless/Exceptionless.Net#391 ·
维护者通常 6 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
exceptionless/Exceptionless.Net#390 ·
维护者通常 6 天内回复
-
bug
难度 1/5 1-3 小时 新手友好度 88/100
exceptionless/Exceptionless.Net#387 ·
维护者通常 6 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 35/100
exceptionless/Exceptionless.Net#389 ·
维护者通常 6 天内回复
-
bug
难度 3/5 1-2 天 新手友好度 72/100
exceptionless/Exceptionless.Net#388 ·
维护者通常 6 天内回复
查看 exceptionless/Exceptionless.Net 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 2 天内回复
-
bug effort:S P3
难度 2/5 1-3 小时 新手友好度 85/100
nightscout/nocturne#3093 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 67/100
维护者通常 3 天内回复
-
难度 1/5 1 小时以内 新手友好度 85/100
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复