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.

Enforce functools.wraps on all monkeypatches

See original GitHub issue

I’m using celery-once to make sure some tasks are only run one at a time. The lock is acquired in apply_async and released in after_return.

When I use the CeleryIntegration I’m not seeing any of the locks being released after the task has finished running. I’m not very familiar with the inner workings of celery, but any ideas what’s going on?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
untitakercommented, Jul 15, 2019

Since this is blocking you I’ll just get a minimal fix out of the door.

Proper wrapping will likely take more effort (possibly using wrapt instead of functools).

1reaction
untitakercommented, Jul 10, 2019

We should do this everywhere then. Monkeypatches are quite inconsistent across the codebase.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use functools.wraps or wrapt for decorators #170 - GitHub
The long-term solution here is to not monkey-patch methods onto classes, but in the short run, what should I do? The obvious easy...
Read more >
decorator module vs functools.wraps - python - Stack Overflow
One of the main differences is listed right in the documentation you linked to: decorator preserves the signature of the wrapped function, while...
Read more >
functools — Higher-order functions and operations on callable ...
The functools module is for higher-order functions: functions that act on or return other functions. In general, any callable object can be treated...
Read more >
Python | functools.wraps() function - GeeksforGeeks
wraps () is a decorator that is applied to the wrapper function of a decorator. It updates the wrapper function to look like...
Read more >
Hear no evil, see no evil, patch no evil: Or, how to monkey ...
wraps () help? import functools def function_wrapper(. No, it doesn't solve all problems. Still issues with: introspection, wrapping decorators ...
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