Comments (9)
Could you please tell me how can I reproduce it?
from thriftpy.
目前只有我们线上环境会报此问题,线上部署方式为k8s集群部署:
服务端: python3.6 + thriftpy + gunicorn_thrift 1个容器
客户端: python2.7 + thriftpy + thrift_connector 4个容器
服务端配置如下:
manage.py
# coding: utf-8
import logging.config
from thriftpy.thrift import TProcessor
from mle_basic import thrift_service
from mle_basic.settings import logging_config
from mle_basic.dispatchers.base import BasicServiceDispatcher
logging.config.dictConfig(logging_config)
service = thrift_service.BasicService
app = TProcessor(service=service, handler=BasicServiceDispatcher())
gunicorn_config.py如下:
# coding: utf-8
workers = 8
worker_class = "thriftpy_gevent"
thrift_protocol_factory = "thriftpy.protocol:TCyBinaryProtocolFactory"
thrift_transport_factory = "thriftpy.transport:TCyBufferedTransportFactory"
errorlog = '-'
启动脚本run-server.sh如下
#! /bin/sh
gunicorn_thrift manage:app -c gunicorn_config.py --bind 0.0.0.0:10000
客户端配置如下 basic_rpc.py:
# coding: utf-8
import os
import json
import logging
from thrift_connector import ClientPool, ThriftPyCyClient
from db_service import service # severice为thriftpy.load("xxx.thrift")后的
BASIC_SERVICE_HOST = os.environ.get('BASIC_SERVICE_HOST', '0.0.0.0')
BASIC_SERVICE_PORT = int(os.environ.get('BASIC_SERVICE_PORT', 10000))
BASIC_SERVICE_TIMEOUT = 120 # 单位s, 2分钟
class BasicRPC(object):
client = ClientPool(
service=service.BasicService,
host=BASIC_SERVICE_HOST,
port=BASIC_SERVICE_PORT,
timeout=BASIC_SERVICE_TIMEOUT,
max_conn=30,
connection_class=ThriftPyCyClient
)
说明:
当我在本地mac pro 同时启动服务端rpc服务,然后在mac pro本地启动 客户端的项目开始调用时,并无法复现 Interrupted system call
的问题。
我在Ubuntu Linux 16.04同时部署 服务端、客户端时,调用也是正常的,不会出现 Interrupted system call
。
当我在阿里云 K8S同一个集群内,将服务端的rpc服务部署为一个容器, 将thriftpy的客户端部署为两个容器以上时,就会出现 Interrupted system call
的问题,出现的评率,大致为: 我thriftpy client调用10次上面截图中的create_face_list,会引起2~5次的Interrupted system call
.
总结:
单机目前无法复现此问题。
from thriftpy.
I think we have already fixed this issue, see https://github.com/Thriftpy/thriftpy2/pull/9/files
from thriftpy.
https://github.com/Thriftpy/thriftpy2/pull/9/files 在今年9月29日修复的此问题,好像还没有发布pypi包?
感谢,我这边通过源码的方式更新一下,然后测试,测试pass后关掉此issue。
from thriftpy.
I will release it soon, thanks.
from thriftpy.
0.3.12 released, thanks.
from thriftpy.
感谢!
线上测试环境更新到0.3.12后没有再报过Interrupted system call
的错误了。但是今天发现另外的一个问题。
client端稳定调用server端的rpc一段时间后,就会出现: TTransportException(message="Could not connect to ('192.168.160.61', 10000)", type=1)
服务端失联的情形,但是报异常的前后都有调用服务端的接口成功的情况。
问题,出现失联情形,thriftpy + thrift_connector的socket重连机制依赖我们使用thriftpy的应用层代码去人为设置重新请求服务端接口吗?
from thriftpy.
You can retry request manually.
from thriftpy.
Oh, thanks.
from thriftpy.
Related Issues (20)
- Is the Tornado server asynchronous? HOT 2
- Closing server gracefully on SIGTERM HOT 1
- Utf-8-encoded unicode in thrift definition comments causes failure of thriftpy.load in Python 3
- can thriftpy support udp port HOT 1
- Always got a log timeout HOT 1
- thriftpy/thrift.py grammar mistakes ? HOT 2
- Bools often corrupt when written using Compact HOT 2
- TTransportException HOT 1
- install failed in mac osx HOT 2
- 参数里有中文,服务端识别为乱码,需要编码再解码么?
- Cannot install on Python3.7 HOT 5
- 基于什么样的考虑不采用生成代码的方式呢?或者说为什么thrift官方需要采用生成代码的方式呢? HOT 1
- 客户端请求等待问题 HOT 1
- Failed building wheel for thriftpy HOT 1
- Forward reference not supported (ThriftParserError: No type found) HOT 3
- 这个项目还在持续更新吗? HOT 1
- 构造client给apache thrift 0.9.2版本server发送请求,返回数据不正确,请问可能是什么原因 HOT 1
- Confused with absulute path in windows HOT 1
- when i use timeout_decorator, always raise PickleingError 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 thriftpy.