Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

WIP 0.20 #295

Closed
wants to merge 63 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
7f32c4b
start 0.19 changelog
HelloGrayson Oct 20, 2015
5f670e9
remove tchannel.sync.thrift.client_for
HelloGrayson Oct 20, 2015
1427936
remove tchannel.thrift.client_for
HelloGrayson Oct 20, 2015
910fcc2
changelog for removing client_for
HelloGrayson Oct 20, 2015
54fb215
Merge pull request #259 from uber/remove_client_for
Oct 20, 2015
4653a2d
remove thrift_request_builder
HelloGrayson Oct 20, 2015
1e68b68
remove thrift_request_builder from thrift scheme tests
HelloGrayson Oct 20, 2015
bace2d6
update mock_server to use thriftrw
HelloGrayson Oct 21, 2015
932113a
update vcr tests to remove thrift_request_builder dep
HelloGrayson Oct 21, 2015
1ef8620
tests passing without thrift_request_builder
HelloGrayson Oct 21, 2015
3ab0b2a
fix fn defined but never used
HelloGrayson Oct 21, 2015
1ec1ecd
changelog
HelloGrayson Oct 21, 2015
bf4aecf
Merge pull request #264 from uber/delete_thrift_request_builder
Oct 21, 2015
946141e
remove generated thrift test classes
HelloGrayson Oct 21, 2015
518abc1
remove useless test
HelloGrayson Oct 21, 2015
9c4af94
Merge pull request #265 from uber/remove_thrift_generated_code
Oct 21, 2015
29aa4f7
remove explicit dep on futures
HelloGrayson Oct 20, 2015
319e80e
move futures to requirements-test.txt, from setup.py
HelloGrayson Oct 21, 2015
005494f
Merge pull request #260 from uber/remove_futures_dep
Oct 21, 2015
24138f2
Collapse Thrift*Request and THrift*Serializer.
abhinav Oct 22, 2015
6a925d7
Assert that deprecated TChannel is not called with thrift endpoints
abhinav Oct 22, 2015
ac4e086
Move ThriftRequest to tchannel.thrift.rw
abhinav Oct 22, 2015
35f7f14
flake
abhinav Oct 22, 2015
23d47fb
Merge pull request #267 from uber/rm-thrift-req
abhinav Oct 22, 2015
ecafe76
Prevent all tests from using thrift code generation
abhinav Oct 22, 2015
69524b6
Merge pull request #268 from uber/delete-thrift-test
abhinav Oct 22, 2015
58301b4
Makefile targets to thrift --gen are no longer needed
abhinav Oct 23, 2015
7aaf962
reduce zipkin failures to warnings
blampe Oct 24, 2015
3340d23
preserve trace
blampe Oct 26, 2015
2d48598
Merge branch '0.19.0' of github.com:uber/tchannel-python into warn19
blampe Oct 26, 2015
575c426
Merge branch 'master' of github.com:uber/tchannel-python into 0.19.0
blampe Oct 26, 2015
a4cf010
Merge branch '0.19.0' of github.com:uber/tchannel-python into warn19
blampe Oct 26, 2015
44873c6
Merge pull request #273 from uber/warn19
blampe Oct 26, 2015
e1902a0
no more generated code to ignore
blampe Oct 26, 2015
8402331
Merge pull request #274 from uber/generated
blampe Oct 26, 2015
ca017c8
add a note about removing apache thrift support
blampe Oct 26, 2015
7c7d1ac
wording
blampe Oct 26, 2015
bea0c2c
Merge pull request #275 from uber/thrift
blampe Oct 27, 2015
527b169
Merge remote-tracking branch 'origin/master' into 19
jc-fireball Oct 29, 2015
07d9ee3
Limit the size of endpoint , assume endpoint can fit in arg1
jc-fireball Oct 29, 2015
5a903ac
add limitation check on the client side.
jc-fireball Oct 29, 2015
305d6d3
Add more test on the server side for limit of arg1
jc-fireball Oct 30, 2015
61a2adf
address bryce's comment
jc-fireball Oct 30, 2015
149a00d
Improve the log message
jc-fireball Oct 30, 2015
d6e1a0a
Merge pull request #283 from uber/arg1
jc-fireball Oct 30, 2015
e767d8e
WIP
jc-fireball Oct 30, 2015
fa47144
Separate handler for call request and call request continue message
jc-fireball Nov 2, 2015
87fb8df
move _HANLDER to class variable
jc-fireball Nov 3, 2015
b37a12a
update dispatch handler test for better test coverage
jc-fireball Nov 3, 2015
89aeb2a
fix minor nit
jc-fireball Nov 4, 2015
86c764d
Merge pull request #287 from uber/handler
jc-fireball Nov 4, 2015
42d78c8
Remove assertion for connection close instead throwing StreamClosedError
jc-fireball Nov 5, 2015
6947caa
update connection test
jc-fireball Nov 6, 2015
8d1dfd9
change the exception variable name
jc-fireball Nov 6, 2015
30c4d72
Add streamclosederror catpure around stream.connect
jc-fireball Nov 6, 2015
ab0c20a
add change log
jc-fireball Nov 6, 2015
4012b26
Fix changelog formatting.
abhinav Nov 6, 2015
9a88a00
Merge pull request #291 from uber/closed
jc-fireball Nov 7, 2015
4ebc1f2
merge master
HelloGrayson Nov 7, 2015
1cae109
use thriftrw 1.0
HelloGrayson Nov 6, 2015
3248121
Update changelog
abhinav Nov 6, 2015
f1f056f
fix thriftrw integration
HelloGrayson Nov 6, 2015
bf2193e
Merge pull request #296 from uber/thriftrw-1.0
Nov 7, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
Changes by Version
==================

0.19.1 (unreleased)
-------------------

- Nothing changed yet.
0.20.0 (unreleased)
-------------------

- **BREAKING** - Removed support for the Apache ``thrift`` library.
- **BREAKING** - Removed ``tchannel.thrift.client_for`` and
``tchannel.sync.thrift.client_for`` as planned in 0.18.
- **BREAKING** - Removed ``tchannel.thrift_request_builder`` as
planned in 0.18.
- Reduced Zipkin submission failures to warnings.
- Limit the size of arg1 to 16KB.
- Fix bug which prevented requests from being retried if the candidate
connection was previously terminated.
- Support thriftrw 1.0.


0.19.0 (2015-11-06)
Expand Down
8 changes: 0 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,3 @@ docs:
.PHONY: docsopen
docsopen: docs
open docs/_build/html/index.html

.PHONY: vcr-thrift
vcr-thrift:
make -C ./tchannel/testing/vcr all

.PHONY: gen_thrift
gen_thrift:
thrift --gen py:new_style,slots,dynamic -out tests/data/generated tests/data/idls/ThriftTest.thrift
12 changes: 12 additions & 0 deletions requirements-test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@ psutil
# Test all the pythons
tox

#
# futures is installed implicitly through threadloop,
# but tox has an issue where it doesn't pick that up,
# causing tests to fail. This can be reproduced locally
# by removing futures from this file and running:
#
# tox -e py27 tests
#
# @see https://travis-ci.org/uber/tchannel-python/jobs/86710564
#
futures

# Syntax checker
flake8==2.2.5

Expand Down
10 changes: 0 additions & 10 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,6 @@
create-wheel = yes
python-file-with-version = tchannel/__init__.py

[flake8]
# Ignore files generated by Thrift
exclude =
examples/guide/keyvalue/keyvalue/service/*,
examples/benchmark/thrift/service/*,
tchannel/health/thrift/*,
tchannel/zipkin/thrift/*,
tchannel/testing/vcr/proxy/*,
tests/data/generated/ThriftTest/*

[pytest]
markers =
call: mark a test as using the client's calling API.
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,13 @@
install_requires=[
# stdlib backports, no constraints needed
'contextlib2',
'futures',

# external deps
'crcmod>=1,<2',
'tornado>=4.2,<5',

# tchannel deps
'thriftrw>=0.4,<0.6',
'thriftrw>=1,<2',
'threadloop>=1,<2',
],
extras_require={
Expand Down
1 change: 0 additions & 1 deletion tchannel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,3 @@
from .response import Response # noqa
from .request import Request # noqa
from .tchannel import TChannel # noqa
from .thrift import thrift_request_builder # noqa
3 changes: 3 additions & 0 deletions tchannel/glossary.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
# CallRequestMessage uses it as the default TTL value for the message.
DEFAULT_TIMEOUT = 30 # seconds

# Max size of arg1.
MAX_SIZE_OF_ARG1 = 16 * 1024

TCHANNEL_LANGUAGE = 'python'

# python environment, eg 'CPython-2.7.10'
Expand Down
24 changes: 9 additions & 15 deletions tchannel/schemes/thrift.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,24 +141,18 @@ def __call__(
)
body = serializer.deserialize_body(body=response.body)

# TODO read_body and get_serializer were added so that we could fork
# behavior on whether Apache Thrift was being used or thriftrw. That's
# no longer required. Move that behavior back here.
response.body = request.read_body(body)
raise gen.Return(response)

def register(self, thrift_module, **kwargs):
# dat circular import
from tchannel.thrift import rw as thriftrw

if isinstance(thrift_module, thriftrw.Service):
# Dirty hack to support thriftrw and old API
return thriftrw.register(
# TODO drop deprecated tchannel
self._tchannel._dep_tchannel._handler,
thrift_module,
**kwargs
)
else:
return self._tchannel.register(
scheme=self.NAME,
endpoint=thrift_module,
**kwargs
)
return thriftrw.register(
# TODO drop deprecated tchannel
self._tchannel._dep_tchannel._handler,
thrift_module,
**kwargs
)
48 changes: 4 additions & 44 deletions tchannel/serializer/thrift.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ class ThriftSerializer(object):
rw.len_prefixed_string(rw.number(2)),
)

def __init__(self, deserialize_type):
__slots__ = ('module', 'deserialize_type')

def __init__(self, module, deserialize_type):
self.module = module
self.deserialize_type = deserialize_type

def serialize_header(self, headers):
Expand All @@ -56,49 +59,6 @@ def deserialize_header(self, headers):

return result

def serialize_body(self, call_args):

# TODO - use fastbinary directly
#
# fastbinary.encode_binary(
# call_args, (call_args.__class__, call_args.thrift_spec)
# )
# fastbinary.decode_binary(
# result, TMemoryBuffer(body),(result_type, result_type.thrift_spec)
# )
#
from thrift.protocol import TBinaryProtocol
from thrift.transport import TTransport
trans = TTransport.TMemoryBuffer()
proto = TBinaryProtocol.TBinaryProtocolAccelerated(trans)
call_args.write(proto)
result = trans.getvalue()

return result

def deserialize_body(self, body):
from thrift.protocol import TBinaryProtocol
from thrift.transport import TTransport
trans = TTransport.TMemoryBuffer(body)
proto = TBinaryProtocol.TBinaryProtocolAccelerated(trans)

result = self.deserialize_type()
result.read(proto)
return result


class ThriftRWSerializer(ThriftSerializer):

def __init__(self, module, deserialize_type):
"""
:param module:
thriftrw generated module
"""
# TODO export dumps/loads on classes in thriftrw in addition to
# module-level dumps/loads.
super(ThriftRWSerializer, self).__init__(deserialize_type)
self.module = module

def serialize_body(self, obj):
return self.module.dumps(obj)

Expand Down
128 changes: 0 additions & 128 deletions tchannel/sync/thrift.py

This file was deleted.

15 changes: 0 additions & 15 deletions tchannel/testing/vcr/Makefile

This file was deleted.

3 changes: 0 additions & 3 deletions tchannel/thrift/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,4 @@

from __future__ import absolute_import

from .client import client_for # noqa
from .module import thrift_request_builder # noqa
from .server import register # noqa
from .rw import load # noqa
Loading