AWS Lambda detection never matches because the environment variable name has a trailing space
Los mantenedores suelen responder en 6 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 76/100
Línea de trabajo
Empieza en src/Exceptionless/Extensions/ExceptionlessConfigurationExtensions.cs, en ReadFromEnvironmentalVariables(), e inspecciona la búsqueda de GetEnvironmentalVariable. Elimina el espacio final del nombre de la variable de AWS Lambda y añade pruebas para las variables de AWS y Azure Functions. Ejecuta las pruebas de configuración pertinentes; se considera terminado cuando la variable de AWS habilita ProcessQueueOnCompletedRequest de forma predeterminada, igual que el comportamiento de Azure.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- C#
- Estrellas
- 573
- Forks
- 143
- Merge medio
- 5 d 9 h
- PR fusionados (30 d)
- 1
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de exceptionless/Exceptionless.Net
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
exceptionless/Exceptionless.Net#391 ·
Los mantenedores suelen responder en 6 días
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
exceptionless/Exceptionless.Net#390 ·
Los mantenedores suelen responder en 6 días
-
bug
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
exceptionless/Exceptionless.Net#387 ·
Los mantenedores suelen responder en 6 días
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 35/100
exceptionless/Exceptionless.Net#389 ·
Los mantenedores suelen responder en 6 días
-
bug
Dificultad 3/5 1-2 días Aptitud para principiantes 72/100
exceptionless/Exceptionless.Net#388 ·
Los mantenedores suelen responder en 6 días
Todos los issues de exceptionless/Exceptionless.Net
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
Los mantenedores suelen responder en 1 día
-
Исправить опечатки в протоколеAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 76/100
GameShowLDA/AskMkiM#1075 ·
Los mantenedores suelen responder en 1 día
-
kind/bug triage/untriaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
unoplatform/uno.resizetizer#414 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día