Skip to content

Multiprocessing integration #291

Open

Description

@untitaker

We do support fork() in general, but the multiprocessing module has some quirks.

  • atexit does not get called, so events get lost
  • Unhandled exceptions are not captured

An integration should fix both. We should also consider Billard, a fork of mulitprocessing here. If we manage to properly hook into both versions, we can catch some startup errors in Celery as well.

If you're interested in this, please give this post a 👍 so it's easier to track.

Activity

  1. added
    New Integration
    on Mar 13, 2019
  2. untitaker commented on Mar 20, 2019

    @untitaker
    MemberAuthor

    @rouge8 @crepererum can you clarify whether you want this because of celery or something else? After creating this issue I discovered that Celery issues need to be tackled separately.

  3. crepererum commented on Mar 20, 2019

    @crepererum
    Contributor

    Dask is able to use local processes as a local backend, and it would be really helpful to at least get the queues flushed properly (atexit). But maybe a direct dask (and even distributed) integration would be more helpful.

  4. untitaker commented on Mar 20, 2019

    @untitaker
    MemberAuthor

    @crepererum could you open a new issue wrt Dask support? The more I think about this (multiprocessing) support the more I thikn it's an A/B problem.

  5. rouge8 commented on Mar 21, 2019

    @rouge8

    can you clarify whether you want this because of celery or something else?

    I was reviewing the open issues while migrating away from the old raven library. :) We have some code that uses multiprocessing, but I haven't compared behavior with raven and sentry_sdk or anything yet.

  6. ashb commented on Jan 15, 2020

    @ashb

    A change in Apache Airflow (to use os.fork, and thus the recommended os._exit() has broken that integration.

    It would be nice to have a way to explicitly call the Sentry exit handler. https://issues.apache.org/jira/browse/AIRFLOW-6569 /cc @tiopi

  7. github-actions commented on Dec 23, 2021

    @github-actions
    Contributor

    This issue has gone three weeks without activity. In another week, I will close it.

    But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


    "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

  8. added
    Triaged
    on Jul 31, 2023
  9. 2 remaining items

  10. moved this to Waiting for: Product Owner in GitHub Issues with 👀 2on Mar 1, 2024
  11. antonpirker commented on Mar 5, 2024

    @antonpirker
    Contributor

    Hey @davegravy

    This looks solid. For the problem with "handled" you could something like we do in our integrations to have a custom _capture_exception method that sets the handled flag to false. See here: https://github.com/getsentry/sentry-python/blob/sentry-sdk-2.0/sentry_sdk/integrations/asyncio.py#L79-L95

  12. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 2on Mar 5, 2024
  13. added and removed
    Triaged
    on Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ErrorsFeatureNew IntegrationPython

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions