Remove grpc imports from init and add pb package#43
Merged
smacker merged 4 commits intosrc-d:masterfrom Dec 5, 2018
smacker:add_pb_package
Merged
Remove grpc imports from init and add pb package#43smacker merged 4 commits intosrc-d:masterfrom smacker:add_pb_package
smacker merged 4 commits intosrc-d:masterfrom
smacker:add_pb_package
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>
vmarkovtsev
reviewed
Dec 4, 2018
python/lookout/sdk/pb.py
Outdated
|
|
||
| from .event_pb2_grpc import * | ||
| from .event_pb2 import * | ||
| from .grpc import * |
Collaborator
There was a problem hiding this comment.
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_addressSigned-off-by: Maxim Sukharev <max@smacker.ru>
vmarkovtsev
suggested changes
Dec 4, 2018
python/lookout/sdk/pb.py
Outdated
| """ | ||
|
|
||
| from .service_analyzer_pb2_grpc import \ | ||
| AnalyzerServicer, add_AnalyzerServicer_to_server as add_analyzer_to_server |
Collaborator
There was a problem hiding this comment.
AnalyzerServicer does not need to be imported here. Sorry - I should have spotted this earlier!
Contributor
Author
There was a problem hiding this comment.
True. Leftover after copy-past. Thank you!
Signed-off-by: Maxim Sukharev <max@smacker.ru>
vmarkovtsev
approved these changes
Dec 4, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.