Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: generating data diff for a branch with a large data change fails with neo4j.exceptions.TransientError exception #4511

Closed
wvandeun opened this issue Oct 1, 2024 · 0 comments
Assignees
Labels
group/backend Issue related to the backend (API Server, Git Agent) priority/2 This issue stalls work on the project or its dependents, it's a blocker for a release type/bug Something isn't working as expected

Comments

@wvandeun
Copy link
Contributor

wvandeun commented Oct 1, 2024

Component

API Server / GraphQL

Infrahub version

stable

Current Behavior

When you generate a data diff for a branch with a large data change (5.2k new nodes + 2.5k changes), the generation will result in a failure and you see the following logging message:

{"event": "Unhandled exception occurred in resolvers", "request_id": "4f699cabcafe4a76a79c4e8e58d85feb", "app": "infrahub.api", "worker": "9432f176-9230-4d84-a2a6-6230ff3471b4", "timestamp": "2024-10-01T15:47:29.156710Z", "logger": "infrahub.graphql", "level": "critical", "exception": "Traceback (most recent call last):
  File \"/usr/local/lib/python3.12/site-packages/graphql/execution/execute.py\", line 530, in await_result
    return_type, field_nodes, info, path, await result
                                          ^^^^^^^^^^^^
  File \"/source/backend/infrahub/graphql/mutations/diff.py\", line 48, in mutate
    await diff_coordinator.run_update(
  File \"/source/backend/infrahub/core/diff/coordinator.py\", line 84, in run_update
    return await self.update_branch_diff(base_branch=base_branch, diff_branch=diff_branch)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File \"/source/backend/infrahub/core/diff/coordinator.py\", line 143, in update_branch_diff
    await self.diff_repo.save(enriched_diffs=enriched_diffs)
  File \"/source/backend/infrahub/core/diff/repository/repository.py\", line 135, in save
    await query.execute(db=self.db)
  File \"/source/backend/infrahub/core/query/__init__.py\", line 545, in execute
    results, metadata = await db.execute_query_with_metadata(
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File \"/source/backend/infrahub/database/__init__.py\", line 294, in execute_query_with_metadata
    response = await self.run_query(query=query, params=params, name=name)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File \"/source/backend/infrahub/database/__init__.py\", line 312, in run_query
    response = await execution_method.run(query=_query, parameters=params)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File \"/usr/local/lib/python3.12/site-packages/neo4j/_async/work/session.py\", line 314, in run
    await self._auto_result._run(
  File \"/usr/local/lib/python3.12/site-packages/neo4j/_async/work/result.py\", line 221, in _run
    await self._attach()
  File \"/usr/local/lib/python3.12/site-packages/neo4j/_async/work/result.py\", line 409, in _attach
    await self._connection.fetch_message()
  File \"/usr/local/lib/python3.12/site-packages/neo4j/_async/io/_common.py\", line 188, in inner
    await coroutine_func(*args, **kwargs)
  File \"/usr/local/lib/python3.12/site-packages/neo4j/_async/io/_bolt.py\", line 860, in fetch_message
    res = await self._process_message(tag, fields)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File \"/usr/local/lib/python3.12/site-packages/neo4j/_async/io/_bolt5.py\", line 370, in _process_message
    await response.on_failure(summary_metadata or {})
  File \"/usr/local/lib/python3.12/site-packages/neo4j/_async/io/_common.py\", line 245, in on_failure
    raise Neo4jError.hydrate(**metadata)
neo4j.exceptions.TransientError: {code: Neo.TransientError.General.MemoryPoolOutOfMemoryError} {message: The allocation of an extra 432.2 MiB would use more than the limit 2.7 GiB. Currently using 2.4 GiB. dbms.memory.transaction.total.max threshold reached}"}

Expected Behavior

Generation of the data diff should completed normally

Steps to Reproduce

  • start instance of Infrahub
  • load a large data change in a branch
  • create a proposed change for the branch
  • navigate to the data tab, generate the diff
  • monitor the api server logs docker logs -f infrahub-infrahub-server-1

Additional Information

No response

@wvandeun wvandeun added type/bug Something isn't working as expected group/backend Issue related to the backend (API Server, Git Agent) labels Oct 1, 2024
@exalate-issue-sync exalate-issue-sync bot added the priority/2 This issue stalls work on the project or its dependents, it's a blocker for a release label Oct 1, 2024
@exalate-issue-sync exalate-issue-sync bot added this to the Infrahub - 0.16.2 milestone Oct 1, 2024
@exalate-issue-sync exalate-issue-sync bot added the state/planned This issue is planned to be worked on in an upcoming release. label Oct 1, 2024
@exalate-issue-sync exalate-issue-sync bot removed the state/planned This issue is planned to be worked on in an upcoming release. label Oct 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
group/backend Issue related to the backend (API Server, Git Agent) priority/2 This issue stalls work on the project or its dependents, it's a blocker for a release type/bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

2 participants