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

Confirmations task needs to roll back transactions on failure #268

Closed
jeremycline opened this issue Dec 12, 2017 · 0 comments
Closed

Confirmations task needs to roll back transactions on failure #268

jeremycline opened this issue Dec 12, 2017 · 0 comments

Comments

@jeremycline
Copy link
Member

The confirmations task doesn't handle failed transactions:

InvalidRequestError("This Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Session.rollback(). Original exception was: Instance '<QueuedMessage at 0x7fd0dd8fcc90>' has been deleted, or its row is otherwise not present.",)
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/celery/app/trace.py", line 367, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/celery/app/trace.py", line 622, in __protected_call__
    return self.run(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/fmn/tasks.py", line 355, in confirmations
    models.Confirmation.delete_expired(session)
  File "/usr/lib/python2.7/site-packages/fmn/lib/models.py", line 886, in delete_expired
    expired = session.query(cls).filter(cls.created_on < too_old).all()
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/query.py", line 2703, in all
    return list(self)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/query.py", line 2855, in __iter__
    return self._execute_and_instances(context)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/query.py", line 2876, in _execute_and_instances
    close_with_result=True)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/query.py", line 2885, in _get_bind_args
    **kw
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/query.py", line 2867, in _connection_from_session
    conn = self.session.connection(**kw)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/session.py", line 998, in connection
    execution_options=execution_options)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/session.py", line 1003, in _connection_for_bind
    engine, execution_options)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/session.py", line 382, in _connection_for_bind
    self._assert_active()
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/session.py", line 276, in _assert_active
    % self._rollback_exception
InvalidRequestError: This Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction wi
th this Session, first issue Session.rollback(). Original exception was: Instance '<QueuedMessage at 0x7fd0dd8fcc90>' has been deleted, or its row is otherwise not present.
jeremycline added a commit to jeremycline/fmn that referenced this issue Dec 21, 2017
Add SQLAlchemy error handling to the one-shot filter and batch queuing
code.

fixes fedora-infra#268

Signed-off-by: Jeremy Cline <jeremy@jcline.org>
jeremycline added a commit to jeremycline/fmn that referenced this issue Jan 2, 2018
Add SQLAlchemy error handling to the one-shot filter and batch queuing
code.

fixes fedora-infra#268

Signed-off-by: Jeremy Cline <jeremy@jcline.org>
jeremycline added a commit to jeremycline/fmn that referenced this issue Jan 2, 2018
Add SQLAlchemy error handling to the tasks.

fixes fedora-infra#268

Signed-off-by: Jeremy Cline <jeremy@jcline.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant