Skip to content
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

Rollbar with Multiprocessing #407

Open
racterub opened this issue May 18, 2022 · 3 comments
Open

Rollbar with Multiprocessing #407

racterub opened this issue May 18, 2022 · 3 comments
Assignees

Comments

@racterub
Copy link

Hi,
I currently working on rollbar with multiprocessing but encounters a problem.
POC here:

import rollbar
from multiprocessing import Process

def test():
    rollbar.init("<post_server_token_here>")
    print(rollbar.report_message("foo"))


if __name__ == "__main__":
    p = Process(target=test)
    p.start()
    p.join()

When executing script with various python version, only python3.9 is working (Item created on rollbar dashboard)

❯ python2.7 a.py
ba97cff1-b03c-4eb7-a0c9-f7e4fcb5dfe1
❯ python3.6 a.py
WARNING:rollbar.lib._async:Python3.6 does not provide the `contextvars` module. Some advanced features may not work as expected. Please upgrade Python or install `aiocontextvars`.
75866ec2-b84b-4828-9339-152d4894b6d9
❯ python3.9 a.py
ac109c6a-c207-4b77-b192-5500a3109d4a

Rollbar Dashboard:
圖片

@racterub
Copy link
Author

I think it's python version problem here.
After removing threading inside _send_payload_thread, everything works.

@danielmorell danielmorell self-assigned this May 19, 2022
@danielmorell
Copy link
Collaborator

Hi @racterub thank you for bringing this to our attention with all the details and helpful context. The POC and results give a very clear representation of what is going on. Would you be willing to add a test and update the codebase, or would you like me to do that?

@racterub
Copy link
Author

racterub commented Jun 9, 2022

Hi @danielmorell
Sorry for the late reply.
I'm sorry I'm not familiar with unittest :(

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

No branches or pull requests

2 participants