Skip to content
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

Set socket timeout unconditionally on TSocket #146

Merged
merged 1 commit into from Dec 14, 2016
Merged

Set socket timeout unconditionally on TSocket #146

merged 1 commit into from Dec 14, 2016

Conversation

ecederstrand
Copy link
Contributor

Since thriftpy 0.3.3, there has been a socket_timeout option to TSocket. The default is 3000 ms. Setting it to None means "never timeout". Remove the if self.timeout is not None conditional so a value of None can also be set explicitly from happybase.

Since thriftpy 0.3.3, there has been a `socket_timeout` option to `TSocket`. The default is 3000 ms. Setting it to `None` means "never timeout". Remove the `if self.timeout is not None` conditional so a value of `None` can also be set explicitly from happybase.
@wbolster
Copy link
Member

looks good, thanks

@wbolster wbolster merged commit e836657 into python-happybase:master Dec 14, 2016
@wbolster
Copy link
Member

make sure to try master, that change is not in 1.0.0 afaik

@dinesh1218
Copy link

@wbolster I am facing TTransportException(message='TSocket read 0 bytes', type=4) . if my connection is idle for sometime when I try to hit a service. When I hit the same service second time I am able to connect and get data.

My connection looks like this

connectionpool=happybase.ConnectionPool(size=size,host=host,port=port,table_prefix=namespace, timeout=None,autoconnect=False)

To avoid timeout I am passing timeout=None but still i'm facing the same exception. Below is the configuration

Happybase - 1.2.0
Thriftpy - 0.4.4
Python - 3.6
HBase - 2.1.2

I start Thrift with ./hbase-daemon.sh start thrift

Am I doing something wrong? Please guide me to overcome this exception

@wbolster
Copy link
Member

unfortunately i don't know how this happens. it may be the thrift server, or something im the thrift library... :(

@jeetu96
Copy link

jeetu96 commented Mar 31, 2021

@dinesh1218 did you find any solution ? I am also facing the same issue.
@wbolster any update on how to resolve this exception ?

@wbolster
Copy link
Member

no idea, the problem is likely not in happybase itself.

also this ticket is many years old. no point chatting here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants