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

PicklingError When Running helloworld Script #264

Open
Ivancles opened this issue May 16, 2024 · 1 comment
Open

PicklingError When Running helloworld Script #264

Ivancles opened this issue May 16, 2024 · 1 comment

Comments

@Ivancles
Copy link

Hi everyone 👋,

I'm encountering a problem when trying to run the helloworld script. The error message I receive is a PicklingError related to multiprocessing. It seems that the issue is because I'm trying to pickle a function (book_ride) which can't be pickled since it's not the same object as services.booking_service.booking.book_ride.

I've attached an image of the error message below for reference.

Steps to Reproduce:

Clone the repository.
Navigate to the helloworld directory.
Run the script using the command python helloworld.py.
Error Message:
image

PicklingError: Can't pickle <function book_ride at 0x...>: it's not the same object as services.booking_service.booking.book_ride
Additional Context:

From my investigation, it appears that the function book_ride is being referenced incorrectly in the context of multiprocessing, leading to the pickling issue.

Environment:

Python version: 3.10.14
Operating system: W10
Any other relevant details: conductor-python==1.1.5

Any help to resolve this issue would be greatly appreciated.

Thank you!

@maRT-sk
Copy link

maRT-sk commented Jun 30, 2024

I encountered the same issue and found a workaround. Here’s what I did:

    workers = [
        HelloWorker(task_definition_name='hello_task')
    ]
    configuration = Configuration()
    with TaskHandler(workers=workers, configuration=configuration) as task_handler:
        task_handler.start_processes()
        task_handler.join_processes()

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