Merge github.com:grpc/grpc into we-dont-need-no-backup

pull/1888/head
Craig Tiller 10 years ago
commit 43de01a25c
  1. 17
      composer.json
  2. 2
      src/csharp/Grpc.Auth/Grpc.Auth.nuspec
  3. 2
      src/csharp/Grpc.Core/Grpc.Core.nuspec
  4. 7
      src/csharp/Grpc.nuspec
  5. 2
      src/python/interop/interop/_insecure_interop_test.py
  6. 2
      src/python/interop/interop/_secure_interop_test.py
  7. 2
      src/python/src/grpc/_adapter/_blocking_invocation_inline_service_test.py
  8. 2
      src/python/src/grpc/_adapter/_event_invocation_synchronous_event_service_test.py
  9. 2
      src/python/src/grpc/_adapter/_future_invocation_asynchronous_event_service_test.py
  10. 2
      src/python/src/grpc/_adapter/_links_test.py
  11. 2
      src/python/src/grpc/_adapter/_lonely_rear_link_test.py
  12. 2
      src/python/src/grpc/_adapter/_low_test.py
  13. 2
      src/python/src/grpc/early_adopter/implementations_test.py
  14. 2
      src/python/src/grpc/framework/base/implementations_test.py
  15. 2
      src/python/src/grpc/framework/face/blocking_invocation_inline_service_test.py
  16. 2
      src/python/src/grpc/framework/face/event_invocation_synchronous_event_service_test.py
  17. 2
      src/python/src/grpc/framework/face/future_invocation_asynchronous_event_service_test.py
  18. 2
      src/python/src/grpc/framework/foundation/_later_test.py
  19. 2
      src/python/src/grpc/framework/foundation/_logging_pool_test.py
  20. 7
      src/ruby/bin/interop/interop_server.rb
  21. 1
      src/ruby/lib/grpc/generic/active_call.rb
  22. 28
      src/ruby/lib/grpc/generic/bidi_call.rb
  23. 1
      src/ruby/lib/grpc/generic/rpc_desc.rb
  24. 2
      test/compiler/python_plugin_test.py
  25. 2
      vsprojects/nuget_package/grpc.native.csharp_ext.nuspec

@ -0,0 +1,17 @@
{
"name": "grpc/grpc",
"type": "library",
"description": "gRPC library for PHP",
"keywords": ["rpc"],
"homepage": "http://grpc.io",
"license": "BSD-3-Clause",
"require": {
"php": ">=5.5.0",
"google/auth": "dev-master"
},
"autoload": {
"psr-4": {
"Grpc\\": "src/php/lib/Grpc/"
}
}
}

@ -7,7 +7,7 @@
<description>Auth library for C# implementation of gRPC - an RPC library and framework. See project site for more info.</description>
<version>0.5.0</version>
<authors>Google Inc.</authors>
<owners>jtattermusch</owners>
<owners>grpc-packages</owners>
<licenseUrl>https://github.com/grpc/grpc/blob/master/LICENSE</licenseUrl>
<projectUrl>https://github.com/grpc/grpc</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>

@ -7,7 +7,7 @@
<description>Core C# implementation of gRPC - an RPC library and framework. See project site for more info.</description>
<version>0.5.0</version>
<authors>Google Inc.</authors>
<owners>jtattermusch</owners>
<owners>grpc-packages</owners>
<licenseUrl>https://github.com/grpc/grpc/blob/master/LICENSE</licenseUrl>
<projectUrl>https://github.com/grpc/grpc</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>

@ -7,7 +7,7 @@
<description>C# implementation of gRPC - an RPC library and framework. See project site for more info.</description>
<version>0.5.0</version>
<authors>Google Inc.</authors>
<owners>jtattermusch</owners>
<owners>grpc-packages</owners>
<licenseUrl>https://github.com/grpc/grpc/blob/master/LICENSE</licenseUrl>
<projectUrl>https://github.com/grpc/grpc</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
@ -18,5 +18,8 @@
<dependency id="Grpc.Core" version="0.5.0" />
</dependencies>
</metadata>
<files/>
<files>
<file src="protoc.exe" target="tools" />
<file src="grpc_csharp_plugin.exe" target="tools" />
</files>
</package>

@ -54,4 +54,4 @@ class InsecureInteropTest(
if __name__ == '__main__':
unittest.main()
unittest.main(verbosity=2)

@ -61,4 +61,4 @@ class SecureInteropTest(
if __name__ == '__main__':
unittest.main()
unittest.main(verbosity=2)

@ -43,4 +43,4 @@ class BlockingInvocationInlineServiceTest(
if __name__ == '__main__':
unittest.main()
unittest.main(verbosity=2)

@ -43,4 +43,4 @@ class EventInvocationSynchronousEventServiceTest(
if __name__ == '__main__':
unittest.main()
unittest.main(verbosity=2)

@ -43,4 +43,4 @@ class FutureInvocationAsynchronousEventServiceTest(
if __name__ == '__main__':
unittest.main()
unittest.main(verbosity=2)

@ -274,4 +274,4 @@ class RoundTripTest(unittest.TestCase):
if __name__ == '__main__':
unittest.main()
unittest.main(verbosity=2)

@ -97,4 +97,4 @@ class LonelyRearLinkTest(unittest.TestCase):
if __name__ == '__main__':
unittest.main()
unittest.main(verbosity=2)

@ -399,4 +399,4 @@ class ExpirationTest(unittest.TestCase):
if __name__ == '__main__':
unittest.main()
unittest.main(verbosity=2)

@ -177,4 +177,4 @@ class EarlyAdopterImplementationsTest(unittest.TestCase):
if __name__ == '__main__':
unittest.main()
unittest.main(verbosity=2)

@ -77,4 +77,4 @@ class ImplementationsTest(
if __name__ == '__main__':
unittest.main()
unittest.main(verbosity=2)

@ -43,4 +43,4 @@ class BlockingInvocationInlineServiceTest(
if __name__ == '__main__':
unittest.main()
unittest.main(verbosity=2)

@ -43,4 +43,4 @@ class EventInvocationSynchronousEventServiceTest(
if __name__ == '__main__':
unittest.main()
unittest.main(verbosity=2)

@ -43,4 +43,4 @@ class FutureInvocationAsynchronousEventServiceTest(
if __name__ == '__main__':
unittest.main()
unittest.main(verbosity=2)

@ -148,4 +148,4 @@ class LaterTest(unittest.TestCase):
self.assertEqual(return_value, future_passed_to_callback_cell[0].result())
if __name__ == '__main__':
unittest.main()
unittest.main(verbosity=2)

@ -61,4 +61,4 @@ class LoggingPoolTest(unittest.TestCase):
if __name__ == '__main__':
unittest.main()
unittest.main(verbosity=2)

@ -128,16 +128,19 @@ class TestTarget < Grpc::Testing::TestService::Service
cls = StreamingOutputCallResponse
Thread.new do
begin
GRPC.logger.info('interop-server: started receiving')
reqs.each do |req|
GRPC.logger.info("read #{req.inspect}")
resp_size = req.response_parameters[0].size
GRPC.logger.info("read a req, response size is #{resp_size}")
resp = cls.new(payload: Payload.new(type: req.response_type,
body: nulls(resp_size)))
q.push(resp)
end
GRPC.logger.info('finished reads')
GRPC.logger.info('interop-server: finished receiving')
q.push(self)
rescue StandardError => e
GRPC.logger.info('interop-server: failed')
GRPC.logger.warn(e)
q.push(e) # share the exception with the enumerator
end
end

@ -39,6 +39,7 @@ class Struct
return nil if status.nil?
fail GRPC::Cancelled if status.code == GRPC::Core::StatusCodes::CANCELLED
if status.code != GRPC::Core::StatusCodes::OK
GRPC.logger.debug("Failing with status #{status}")
# raise BadStatus, propagating the metadata if present.
md = status.metadata
with_sym_keys = Hash[md.each_pair.collect { |x, y| [x.to_sym, y] }]

@ -100,6 +100,7 @@ module GRPC
replys = gen_each_reply.call(each_queued_msg)
@enq_th = start_write_loop(replys, is_client: false)
@loop_th = start_read_loop
@enq_th.join if @enq_th.alive?
end
private
@ -115,7 +116,7 @@ module GRPC
return enum_for(:each_queued_msg) unless block_given?
count = 0
loop do
GRPC.logger.debug("each_queued_msg: msg##{count}")
GRPC.logger.debug("each_queued_msg: waiting##{count}")
count += 1
req = @readq.pop
GRPC.logger.debug("each_queued_msg: req = #{req}")
@ -123,70 +124,73 @@ module GRPC
break if req.equal?(END_OF_READS)
yield req
end
@enq_th.join if @enq_th.alive?
end
# during bidi-streaming, read the requests to send from a separate thread
# read so that read_loop does not block waiting for requests to read.
def start_write_loop(requests, is_client: true)
Thread.new do # TODO: run on a thread pool
write_tag = Object.new
GRPC.logger.debug('bidi-write-loop: starting')
begin
write_tag = Object.new
count = 0
requests.each do |req|
GRPC.logger.debug("bidi-write_loop: #{count}")
GRPC.logger.debug("bidi-write-loop: #{count}")
count += 1
payload = @marshal.call(req)
@call.run_batch(@cq, write_tag, INFINITE_FUTURE,
SEND_MESSAGE => payload)
end
GRPC.logger.debug("bidi-write-loop: #{count} writes done")
if is_client
GRPC.logger.debug("bidi-write-loop: sent #{count}, waiting")
GRPC.logger.debug("bidi-write-loop: client sent #{count}, waiting")
@call.run_batch(@cq, write_tag, INFINITE_FUTURE,
SEND_CLOSE_FROM_CLIENT => nil)
batch_result = @call.run_batch(@cq, write_tag, INFINITE_FUTURE,
SEND_CLOSE_FROM_CLIENT => nil,
RECV_STATUS_ON_CLIENT => nil)
batch_result.check_status
end
rescue StandardError => e
GRPC.logger.warn('bidi-write_loop: failed')
GRPC.logger.warn('bidi-write-loop: failed')
GRPC.logger.warn(e)
raise e
end
GRPC.logger.debug('bidi-write-loop: finished')
end
end
# starts the read loop
def start_read_loop
Thread.new do
GRPC.logger.debug('bidi-read-loop: starting')
begin
read_tag = Object.new
count = 0
# queue the initial read before beginning the loop
loop do
GRPC.logger.debug("bidi-read_loop: #{count}")
GRPC.logger.debug("bidi-read-loop: #{count}")
count += 1
# TODO: ensure metadata is read if available, currently it's not
batch_result = @call.run_batch(@cq, read_tag, INFINITE_FUTURE,
RECV_MESSAGE => nil)
# handle the next message
if batch_result.message.nil?
GRPC.logger.debug("bidi-read-loop: null batch #{batch_result}")
@readq.push(END_OF_READS)
GRPC.logger.debug('bidi-read-loop: done reading!')
break
end
# push the latest read onto the queue and continue reading
GRPC.logger.debug("received req: #{batch_result.message}")
res = @unmarshal.call(batch_result.message)
@readq.push(res)
end
rescue StandardError => e
GRPC.logger.warn('bidi: read_loop failed')
GRPC.logger.warn('bidi: read-loop failed')
GRPC.logger.warn(e)
@readq.push(e) # let each_queued_msg terminate with this error
end
GRPC.logger.debug('bidi-read-loop: finished')
end
end
end

@ -137,6 +137,7 @@ module GRPC
def send_status(active_client, code, details, **kw)
details = 'Not sure why' if details.nil?
GRPC.logger.debug("Sending status #{code}:#{details}")
active_client.send_status(code, details, code == OK, **kw)
rescue StandardError => e
GRPC.logger.warn("Could not send status #{code}:#{details}")

@ -520,4 +520,4 @@ class PythonPluginTest(unittest.TestCase):
if __name__ == '__main__':
os.chdir(os.path.dirname(sys.argv[0]))
unittest.main()
unittest.main(verbosity=2)

@ -4,7 +4,7 @@
<id>grpc.native.csharp_ext</id>
<version>0.9.0.0</version>
<authors>Google Inc.</authors>
<owners>Jan Tattermusch</owners>
<owners>grpc-packages</owners>
<licenseUrl>https://github.com/grpc/grpc/blob/master/LICENSE</licenseUrl>
<projectUrl>http://github.com/grpc/grpc</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>

Loading…
Cancel
Save