
GITHUB . COM {
}
Detected CMS Systems:
- Wordpress (2 occurrences)
Title:
Chain and chord exception handling Β· Issue #1014 Β· celery/celery
Description:
For example this simple chain: result = (add.s('1', 2) | mul.s(3))() result.state # 'PENDING' result.get() # Never returns or raises any exception on client-side. # Expected result:...
Website Age:
17 years and 8 months (reg. 2007-10-09).
Matching Content Categories {π}
- Personal Finance
- Business & Finance
- Books & Literature
Content Management System {π}
What CMS is github.com built with?
Github.com uses WORDPRESS.
Traffic Estimate {π}
What is the average monthly size of github.com audience?
ππ Tremendous Traffic: 10M - 20M visitors per month
Based on our best estimate, this website will receive around 10,000,019 visitors per month in the current month.
However, some sources were not loaded, we suggest to reload the page to get complete results.
check SE Ranking
check Ahrefs
check Similarweb
check Ubersuggest
check Semrush
How Does Github.com Make Money? {πΈ}
Subscription Packages {π³}
We've located a dedicated page on github.com that might include details about subscription plans or recurring payments. We identified it based on the word pricing in one of its internal links. Below, you'll find additional estimates for its monthly recurring revenues.How Much Does Github.com Make? {π°}
Subscription Packages {π³}
Prices on github.com are in US Dollars ($).
They range from $4.00/month to $21.00/month.
We estimate that the site has approximately 4,989,889 paying customers.
The estimated monthly recurring revenue (MRR) is $20,957,532.
The estimated annual recurring revenues (ARR) are $251,490,385.
Wordpress Themes and Plugins {π¨}
What WordPress theme does this site use?
It is strange but we were not able to detect any theme on the page.
What WordPress plugins does this website use?
It is strange but we were not able to detect any plugins on the page.
Keywords {π}
exception, return, commented, def, chain, parent, adds, contributor, result, projects, issue, task, buster, metadata, exceptions, celerytask, sign, code, meowcoder, aaronharnly, tinput, printt, input, celery, pull, call, workaround, raise, finish, subtask, exceptionfilter, subtasks, node, group, work, highcat, request, navigation, requests, actions, security, chord, handling, closed, muls, resultstate, pending, resultget, raises, typeerror,
Topics {βοΈ}
local field set pull request personal information chain unsupported operand type task finishes executing task def starttasks comment metadata assignees pretty easily check executed mul subtask task def t1 task def t2 task def t3 task def t4 projects = celery def wrapper parent task raises type projects return celery def filter_exceptions status projects milestone raise exception contributor btw def check_exception avoid exception_filter easily check pending state simple chain ='test-chain' def test_chain header = celery subtask throws labels type target task return fn case return 'chain' object exception caught result = entry_point return exceptions[0] client-side active tasks detailed analysis propagate=true default behavior standard behaviour error easiest thing request context simply update
Payment Methods {π}
- Braintree
Questions {β}
- Already have an account?
- Am I doing something wrong or is this a bug?
- Can you also easily check for a workflow like this?
- However, do you know why a double-wrapped chain result appears to lose its parent?
- Why is this not working?
- Am i doing something fundamentally wrong?
Schema {πΊοΈ}
DiscussionForumPosting:
context:https://schema.org
headline:Chain and chord exception handling
articleBody:For example this simple chain:
``` python
result = (add.s('1', 2) | mul.s(3))()
result.state # 'PENDING'
result.get()
# Never returns or raises any exception on client-side.
# Expected result:
result.state # 'FAILURE' or something
result.get()
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
# skipped
TypeError: cannot concatenate 'str' and 'int' objects
# Here is a hacky workaround:
def check_exception(fn):
def wrapper(*args, **kw):
lst = list(args) + list(kw.values())
exceptions = [x for x in lst if isinstance(x, Exception)]
if exceptions:
return exceptions[0]
try:
return fn(*args, **kw)
except Exception, exc:
return exc
return wrapper
@celery.task(name='add')
@check_exception
def add(x, y):
return x + y
# in this case return value is:
TypeError("unsupported operand type(s) for +: 'int' and 'str'")
# which is also acceptable, even though raise would be more appropriate
```
Well, actually get() blocks, as for chain I don't know what's happening to it, looks like it just vanishes into the void, at least I don't see any scheduled or active tasks.
Am I doing something wrong or is this a bug?
**UPDATE**
``` python
@celery.task(name='test-chain')
def test_chain(x):
finish = finished.s()
a = add.s(x, 2)
a.link_error(finish)
b = mul.s(3)
b.link_error(finish)
return celery.chain(a, b, finish)
```
This code actually kinda works, I get to wait for finish subtask, instead of never executed mul subtask, and I get result every time.
Verbose and not pretty, but it's ok, I guess.
Now there is another issue:
``` python
@celery.task(name='filter_exceptions')
def filter_exceptions(args):
for exception in filter(isexception, args):
raise exception
return args
exception_filter = filter_exceptions.s()
projects = celery.group([get_project.s(id) for id in projects])
header = celery.group(
get_submission.s(submission.id),
get_jira_issue.s(str(submission.sub_ticket))
)
task = (header | exception_filter | projects)
```
Is there any way to avoid exception_filter? Without it get_project subtasks might receive (Exception, issue) tuple as first argument, where as I want get_project subtasks not to execute at all.
author:
url:https://github.com/meowcoder
type:Person
name:meowcoder
datePublished:2012-09-30T18:16:09.000Z
interactionStatistic:
type:InteractionCounter
interactionType:https://schema.org/CommentAction
userInteractionCount:17
url:https://github.com/1014/celery/issues/1014
context:https://schema.org
headline:Chain and chord exception handling
articleBody:For example this simple chain:
``` python
result = (add.s('1', 2) | mul.s(3))()
result.state # 'PENDING'
result.get()
# Never returns or raises any exception on client-side.
# Expected result:
result.state # 'FAILURE' or something
result.get()
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
# skipped
TypeError: cannot concatenate 'str' and 'int' objects
# Here is a hacky workaround:
def check_exception(fn):
def wrapper(*args, **kw):
lst = list(args) + list(kw.values())
exceptions = [x for x in lst if isinstance(x, Exception)]
if exceptions:
return exceptions[0]
try:
return fn(*args, **kw)
except Exception, exc:
return exc
return wrapper
@celery.task(name='add')
@check_exception
def add(x, y):
return x + y
# in this case return value is:
TypeError("unsupported operand type(s) for +: 'int' and 'str'")
# which is also acceptable, even though raise would be more appropriate
```
Well, actually get() blocks, as for chain I don't know what's happening to it, looks like it just vanishes into the void, at least I don't see any scheduled or active tasks.
Am I doing something wrong or is this a bug?
**UPDATE**
``` python
@celery.task(name='test-chain')
def test_chain(x):
finish = finished.s()
a = add.s(x, 2)
a.link_error(finish)
b = mul.s(3)
b.link_error(finish)
return celery.chain(a, b, finish)
```
This code actually kinda works, I get to wait for finish subtask, instead of never executed mul subtask, and I get result every time.
Verbose and not pretty, but it's ok, I guess.
Now there is another issue:
``` python
@celery.task(name='filter_exceptions')
def filter_exceptions(args):
for exception in filter(isexception, args):
raise exception
return args
exception_filter = filter_exceptions.s()
projects = celery.group([get_project.s(id) for id in projects])
header = celery.group(
get_submission.s(submission.id),
get_jira_issue.s(str(submission.sub_ticket))
)
task = (header | exception_filter | projects)
```
Is there any way to avoid exception_filter? Without it get_project subtasks might receive (Exception, issue) tuple as first argument, where as I want get_project subtasks not to execute at all.
author:
url:https://github.com/meowcoder
type:Person
name:meowcoder
datePublished:2012-09-30T18:16:09.000Z
interactionStatistic:
type:InteractionCounter
interactionType:https://schema.org/CommentAction
userInteractionCount:17
url:https://github.com/1014/celery/issues/1014
Person:
url:https://github.com/meowcoder
name:meowcoder
url:https://github.com/meowcoder
name:meowcoder
InteractionCounter:
interactionType:https://schema.org/CommentAction
userInteractionCount:17
interactionType:https://schema.org/CommentAction
userInteractionCount:17
External Links {π}(2)
Analytics and Tracking {π}
- Site Verification - Google
Libraries {π}
- Clipboard.js
- D3.js
- Lodash
Emails and Hosting {βοΈ}
Mail Servers:
- aspmx.l.google.com
- alt1.aspmx.l.google.com
- alt2.aspmx.l.google.com
- alt3.aspmx.l.google.com
- alt4.aspmx.l.google.com
Name Servers:
- dns1.p08.nsone.net
- dns2.p08.nsone.net
- dns3.p08.nsone.net
- dns4.p08.nsone.net
- ns-1283.awsdns-32.org
- ns-1707.awsdns-21.co.uk
- ns-421.awsdns-52.com
- ns-520.awsdns-01.net