Comments (6)
FYI: I fixed the problem of negative size frame by doing this:
val frameFactory = new ThriftFrameCodecFactory(){
override def create(maxFrameSize: Int,
defaultProtocolFactory: TProtocolFactory): ChannelHandler = {
// TODO(agallego): This is A HACK!
// https://github.com/facebook/nifty/issues/144
// import com.google.common.base.Verify.verify
// verify(maxFrameSize > 0, s"Frame size ($maxFrameSize) is negative!")
val twogb:Int = 1 << 30
new DefaultThriftFrameCodec(twogb, defaultProtocolFactory)
}
}
from nifty.
Forgot to mention that I am also using the Binary protocol & TFramed transport.
from nifty.
I also tried the client (python) with thrift 0.9.2 and 0.9.3
from nifty.
I've also, preloaded the netty version
"io.netty" % "netty-all" % "4.0.34.Final",
to my dependencies to make sure this happens with both libs.
my python client code looks like this
def tproto(ip, port):
socket = TSocket.TSocket(ip, port)
transport = TTransport.TFramedTransport(socket)
protocol = TBinaryProtocol.TBinaryProtocol(transport)
return (protocol, transport)
def get_sched_service_client(ip, port):
(protocol, transport) = tproto(ip, port)
client = MyClass.Client(protocol)
transport.open()
return client
from nifty.
perhaps we can use this?
ThriftServerDef serverDef = thriftServerDefBuilder.limitFrameSizeTo(Integer.MAX_VALUE).build();
from nifty.
Bug here is that we should limit max frame size to under 2GB. Maybe should even be limited to just under 1GB I think. At exactly 2GB, you have bit 31 set, which Java treats as negative i32, and anyway thrift doesn't want you to set that bit because a server that understands different incoming protocols from different clients uses it to detect unframed messages.
As for 1GB, its for a similar reason, some Thrift servers also want to leave that space (with either of top two bits set) to detect HTTP incoming messages.
So yes it is a bug, but the bug is we should not allow a large size like that. And your workaround is perfect.
from nifty.
Related Issues (20)
- Does nifty plan to support Thrift0.9.1 HOT 2
- Support for multiplex protocol HOT 2
- NettyServerConfigBuilder instead of NettyConfigBuilder HOT 5
- Publish jars to OSS Snapshots HOT 1
- Compressed Transport HOT 1
- Proper timeout (and other exceptions) handling HOT 1
- Client support to support dynamic host set
- NiftyExceptionLogger.java probably shouldn't log at error severity for broken connections HOT 1
- Upgrading netty
- jdk8 HOT 1
- Expose request queue metrics
- Upgrading netty !!!!! ?
- Test RSA certificate in netty-examples will expire in early 2017
- cancelAllTimeouts?
- nifty support thrift async server in libthrift - 0.9.1?
- Long time no update for this HOT 3
- HTTP content length exceeded 16777216 bytes HOT 1
- Is there any doc?
- Will this project continue to be updated? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nifty.