SystemStackError on selecting records from MySQL
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 20/100
Línea de trabajo
Start with rom/sql/relation.rb:64 and rom/auto_curry.rb:48, then compare them with the reported caller in lib/lf_webapp/repositories/tenants_user_repository.rb:7. Try to reproduce the recursive auto_curry behavior with composite primary keys on MySQL using the listed versions and deployment conditions. Done means identifying the trigger and verifying a fix, or documenting why the environment is required.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
I'm using rom as ORM with Hanami.
Recently, I noticed that sometimes server hanged up raising SystemStackError.
I dug into stack trace, and found that auto_curry method was called too many times.
Here is part of the trace:
SystemStackError: stack level too deep
from rom/sql/relation.rb:64:in `by_pk'
from rom/auto_curry.rb:48:in `block (2 levels) in auto_curry'
: 509 times in total
from rom/auto_curry.rb:48:in `block (2 levels) in auto_curry'
from lib/lf_webapp/repositories/tenants_user_repository.rb:7:in `find'
And here is the caller:
5 def find(tenant_uuid, user_uuid)
6 tenants_users # tenants_users is the intermediate table for many_to_many association
7 .by_pk(tenant_uuid, user_uuid)
8 .one
9 end
Things that I know at this point are:
- The error seems to happen at selecting records from table with composite primary keys
- The error occurs at certain timing after restarting server. Once occurred, it doesn't become normal unless restarting. (requesting count or memory usage may be related?)
- The error hasn't occurred in local environment.
- Invoking
tenants_user_repository.findmethod callsauto_curryonly once in local env.
Here is the environment:
- Server: AWS Elastic Container Service on two t2.micro instances with load balancing
- Deployment: create docker container in CircleCI and push container image to ECS registry
- Database: AWS RDS t2.micro instance running MySQL 5.7
Versions:
ruby 2.5.1
hanami 1.2.0
sequel 5.6.0
rom 4.1.3
rom-changeset 1.0.1
rom-core 4.1.2
rom-mapper 1.1.0
rom-repository 2.0.2
rom-sql 2.4.0
- Lenguaje dominante
- Ruby
- Estrellas
- 220
- Forks
- 97
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
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 rom-rb/rom-sql
-
bug help wanted
Dificultad 4/5 3-5 días Aptitud para principiantes 42/100
-
bug help wanted
Dificultad 3/5 1-2 días Aptitud para principiantes 48/100
-
Relation#last removes combinesAbiertobug help wanted
Dificultad 3/5 1-2 días Aptitud para principiantes 42/100
-
bug help wanted
Dificultad 4/5 3-5 días Aptitud para principiantes 42/100
-
bug help wanted
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
Todos los issues de rom-rb/rom-sql
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 10 días
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
Los mantenedores suelen responder en 2 días