Skip to content

Revert Graph if commit fails #290

@white-gecko

Description

@white-gecko

If the write operation of the commit fails, we need to revert the graph in the store (in memory) as well.

QuitStore/quit/core.py

Lines 426 to 434 in 76f798b

resultingChanges, exception = graph.update(parsedQuery)
if exception:
# TODO need to revert or invalidate the graph at this point.
pass
oid = self.commit(graph, resultingChanges, 'New Commit from QuitStore', parent_commit_ref,
target_ref, query=query, default_graph=default_graph,
named_graph=named_graph)
if exception:
raise exception

There needs to be a try … except block around the commit method, which would revert the update operation/invalidate the graph in case of an exception.

Somehow related to #191

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions