question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature Request: cancel scheduling of failing query after X retries

See original GitHub issue

I have a Redshift query that seems to result in an overflow error:

[2015-10-16 17:37:27,957: ERROR/MainProcess] Task redash.tasks.execute_query[f36ec80c-e9f2-4dec-bfb0-3d44a0920f5c] raised unexpected: Exception('Integer data overflow (multiplication)\nDETAIL:  \n  -----------------------------------------------\n  error:  Integer data overflow (multiplication)\n  code:      1058\n  context:   \n  query:     2268469\n  location:  numeric.hpp:325\n  process:   query1_64 [pid=26484]\n  -----------------------------------------------\n\n',)
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/celery/app/trace.py", line 240, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/opt/redash/redash.0.8.0.stanhu/redash/tasks.py", line 24, in __call__
    return super(BaseTask, self).__call__(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/celery/app/trace.py", line 437, in __protected_call__
    return self.run(*args, **kwargs)
  File "/opt/redash/redash.0.8.0.stanhu/redash/tasks.py", line 312, in execute_query
    raise Exception(error)
Exception: Integer data overflow (multiplication)
DETAIL:  
  -----------------------------------------------
  error:  Integer data overflow (multiplication)
  code:      1058
  context:   
  query:     2268469
  location:  numeric.hpp:325
  process:   query1_64 [pid=26484]
  -----------------------------------------------

It appears that this exception causes celery to retry the same query again and again, causing our database load to be sustained at a high load.

There ought to be a way in redash to alert for these kinds of exceptions and log failed attempts. This one was buried in a supervisor log, and I had to look in the Redshift query log to see that it was trying over and over.

Also, this seems to suggest there are cases where retries are not desirable. I can see the usefulness of retrying due to a DB connection issue, but exceptions caused by a bad query should not warrant a retry.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:9
  • Comments:15 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
Ralnoccommented, May 7, 2019

This is good to see getting added to the current versions. Is there details on how to clean up a scheduled query that is in this state? (i.e. if we have a query in this endless retry state, how do we stop it?)

0reactions
arikfrcommented, May 18, 2017

With #1584 and #1774 I think it’s safe to close this one.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Timeout. Let's try this again. Tuning timeouts and retries at scale.
The application server starts taking on requests that it has to hold on to in memory while it waits for the connection pool...
Read more >
Guide to Spring Retry - Baeldung
A quick and practical guide to implementing retry logic with Spring Retry.
Read more >
Troubleshooting queries in Amazon Redshift Spectrum
If an Amazon Redshift Spectrum request times out, the request is canceled and resubmitted. After five failed retries, the query fails with the...
Read more >
Cleanest way to write retry logic? - Stack Overflow
When a try fails, you simply publish an event saying the try failed, and have the aggregator function re-schedule the event. This allows...
Read more >
Provisioning Task Failing to Start After 40 of 40 Attempts/Retries
Run the query and review any devices that it returns. Delete any duplicate records and then try to start the template again. Common...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found