Skip to content

don't catch database exceptions and ignore them #431

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

Closed
wants to merge 1 commit into from

Conversation

chrono
Copy link

@chrono chrono commented Jun 22, 2016

#359

When the connection to the database disappears, should either implement
reconnection logic or fail hard. This change makes the schedule poller
(and celerybeat) fail hard so that other orchestration can deal with
this, for example by relaunching celerybeat.

celery#359

When the connection to the database disappears, should either implement
reconnection logic or fail hard. This change makes the schedule poller
(and celerybeat) fail hard so that other orchestration can deal with
this, for example by relaunching celerybeat.
@auvipy
Copy link
Member

auvipy commented Jun 22, 2016

thanks for the patch did you run the tests locally?

@chrono
Copy link
Author

chrono commented Jun 22, 2016

Could not find any documentation on how to run the suite. I hear circle is free for open sauce proj

@auvipy
Copy link
Member

auvipy commented Jun 22, 2016

I'm working on adding circle/travis settings.

in the mean time you could just run tox inside your local repo root.

@chrono
Copy link
Author

chrono commented Jun 22, 2016

Test suite passes for py27-1.7 and fails for everything else:

ERROR:   py33-1.7: InterpreterNotFound: python3.3
ERROR:   py33-1.8: InterpreterNotFound: python3.3
ERROR:   py33-1.9: InterpreterNotFound: python3.3
ERROR:   py34-1.7: InterpreterNotFound: python3.4
ERROR:   py34-1.8: InterpreterNotFound: python3.4
ERROR:   py34-1.9: InterpreterNotFound: python3.4
ERROR:   py35-1.7: InterpreterNotFound: python3.5
ERROR:   py35-1.8: InterpreterNotFound: python3.5
ERROR:   py35-1.9: InterpreterNotFound: python3.5

and for py27-1.8:

Double requirement given: Django<1.10.0,>=1.9.0 (already in Django<1.9.0,>=1.8.0, name='Django')
ERROR: could not install deps [-r/Users/martin/projects/django-celery/requirements/default.txt, -r/Users/martin/projects/django-celery/requirements/test.txt, Django>=1.8.0,<1.9.0, Django>=1.9.0,<1.10.0]; v = InvocationError('/Users/martin/projects/django-celery/.tox/py27-1.8/bin/pip install -r/Users/martin/projects/django-celery/requirements/default.txt -r/Users/martin/projects/django-celery/requirements/test.txt Django>=1.8.0,<1.9.0 Django>=1.9.0,<1.10.0 (see /Users/martin/projects/django-celery/.tox/py27-1.8/log/py27-1.8-1.log)', 1)

for py27-1.9:

py27-1.9 runtests: commands[0] | python tests/manage.py test
Traceback (most recent call last):
  File "tests/manage.py", line 8, in <module>
    from django.core.management import execute_from_command_line
ImportError: No module named django.core.management
ERROR: InvocationError: '/Users/martin/projects/django-celery/.tox/py27-1.9/bin/python tests/manage.py test'

assuming this is an issue with my environment / running of the suite, not with the code itself.

@auvipy
Copy link
Member

auvipy commented Jun 22, 2016

tox environment failure is expected as you are running py27 under virtualenv

@chrono
Copy link
Author

chrono commented Jun 22, 2016

An alternative to this proposal could also be the variant done here: f2ad084

@chrono
Copy link
Author

chrono commented Jun 23, 2016

#370 and #376 seem to be addressing the same issue

@auvipy
Copy link
Member

auvipy commented Jun 23, 2016

interesting!! 3 fix for a problem but we failed to notice them!!! thanks @chrono

@chrono
Copy link
Author

chrono commented Jun 27, 2016

can we get one of them merged?

@auvipy
Copy link
Member

auvipy commented Jun 27, 2016

yess need time to review them and decide which approach should be implemented.

except DATABASE_ERRORS as exc:
error('Database gave error: %r', exc, exc_info=1)
return False
last, ts = self._last_timestamp, self.Changes.last_change()
try:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this have to be in a try/finally block?

@auvipy auvipy closed this Dec 20, 2016
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

Successfully merging this pull request may close these issues.

3 participants