Skip to content

Gene Normalizer DB Connection is Constantly Closed #23

@bencap

Description

@bencap

See https://us-west-2.console.aws.amazon.com/cloudwatch/home?region=us-west-2#logsV2:log-groups/log-group/$252Faws$252Felasticbeanstalk$252Fmavedb2-prod-worker-env$252Fvar$252Flog$252Feb-docker$252Fcontainers$252Feb-current-app$252Fstdouterr.log/log-events/i-0d57424da8febff72

When we run worker jobs on stale connections they are constantly closed and cause mapping to fail. It seems this is related to the following lines:

class GeneNormalizerBuilder:
"""Singleton constructor for Gene Normalizer instance."""
def __new__(cls) -> QueryHandler:
"""Provide Gene Normalizer instance. Construct it if unavailable.
:return: singleton instance of ``QueryHandler`` for Gene Normalizer
"""
if not hasattr(cls, "instance"):
db = create_db()
q = QueryHandler(db)
cls.instance = q
return cls.instance

We should probably just create new instances of the db that do not have their connections closed instead of checking the instance state.

Metadata

Metadata

Assignees

Labels

app: mapperTask implementation touches the mappertype: bugSomething isn't workingworkstream: pillarTask relates to pillar project

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions