Skip to content
This repository was archived by the owner on Mar 8, 2020. It is now read-only.
This repository was archived by the owner on Mar 8, 2020. It is now read-only.

bblfsh.decode hangs with multiprocessing #171

Open
@vmarkovtsev

Description

@vmarkovtsev

The following code hangs:

import bblfsh

def decode(uast):
    return bblfsh.decode(uast).load()

uasts = [b"", b"", ...]  # protobuf bytes
pool = multiprocessing.Pool(multiprocessing.cpu_count())
pool.map(decode, uasts)

however this doesn't

def decode(uast):
    import bblfsh
    return bblfsh.decode(uast).load()

uasts = [b"", b"", ...]  # protobuf bytes
pool = multiprocessing.Pool(multiprocessing.cpu_count())
pool.map(decode, uasts)

The reason is likely because gRPC in Python infinitely sucks as always, and it manages to interfere with regular protobuf reading somehow. I wonder if there is a way to fix this.

We had to defer grpc loading in the past when we had similar problems.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions