Skip to content

Conversation

@smacker
Copy link
Contributor

@smacker smacker commented Dec 4, 2018

Superseded #39

The first commit has the same change but correct commit message with the explanation why we need it.
The second re-export grpc stuff as we agreed in a comment to that PR.

Fix the problem reported by @vmarkovtsev:
grpcio has incompatibilies with multiprocessing module.
we may provide functionality that doesn't depend on grpc but it would
still break multiprocessing if we import grpc in __init__.py

See more information (currently opened issues):
- python grpc server with multiprocessing fails
grpc/grpc#16001

- gRPC server on Python 3.6 is incompatible with os.fork()
grpc/grpc#17093

Similar issues;

- grpcio 1.6 python client stuck under multiprocessing
grpc/grpc#12489
- gRPC Python 1.8.2 Library incompatibility with fork()
grpc/grpc#13873

Signed-off-by: Maxim Sukharev <[email protected]>
It makes the api cleaner.
See #39 (comment)
for details.

Signed-off-by: Maxim Sukharev <[email protected]>

from .event_pb2_grpc import *
from .event_pb2 import *
from .grpc import *
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we separate our code from autogenerated one? I would rather explicitly import this:

from lookout.sdk.pb import AnalyzerServicer
from lookout.sdk.grpc import to_grpc_address

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in 03c4166

"""

from .service_analyzer_pb2_grpc import \
AnalyzerServicer, add_AnalyzerServicer_to_server as add_analyzer_to_server
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AnalyzerServicer does not need to be imported here. Sorry - I should have spotted this earlier!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True. Leftover after copy-past. Thank you!

Signed-off-by: Maxim Sukharev <[email protected]>
Copy link
Contributor

@carlosms carlosms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@smacker smacker merged commit 12ecde2 into src-d:master Dec 5, 2018
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

Successfully merging this pull request may close these issues.

3 participants