-
Notifications
You must be signed in to change notification settings - Fork 11
Remove grpc imports from init and add pb package #43
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
Conversation
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 <max@smacker.ru>
It makes the api cleaner. See #39 (comment) for details. Signed-off-by: Maxim Sukharev <max@smacker.ru>
python/lookout/sdk/pb.py
Outdated
|
||
from .event_pb2_grpc import * | ||
from .event_pb2 import * | ||
from .grpc import * |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in 03c4166
Signed-off-by: Maxim Sukharev <max@smacker.ru>
python/lookout/sdk/pb.py
Outdated
""" | ||
|
||
from .service_analyzer_pb2_grpc import \ | ||
AnalyzerServicer, add_AnalyzerServicer_to_server as add_analyzer_to_server |
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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 <max@smacker.ru>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
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.