Giter Site home page Giter Site logo

Comments (9)

ethe avatar ethe commented on June 10, 2024

Could you please tell me how can I reproduce it?

from thriftpy.

lxl0928 avatar lxl0928 commented on June 10, 2024

目前只有我们线上环境会报此问题,线上部署方式为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.

ethe avatar ethe commented on June 10, 2024

I think we have already fixed this issue, see https://github.com/Thriftpy/thriftpy2/pull/9/files

from thriftpy.

lxl0928 avatar lxl0928 commented on June 10, 2024

https://github.com/Thriftpy/thriftpy2/pull/9/files 在今年9月29日修复的此问题,好像还没有发布pypi包?
image

感谢,我这边通过源码的方式更新一下,然后测试,测试pass后关掉此issue。

from thriftpy.

ethe avatar ethe commented on June 10, 2024

I will release it soon, thanks.

from thriftpy.

ethe avatar ethe commented on June 10, 2024

0.3.12 released, thanks.

from thriftpy.

lxl0928 avatar lxl0928 commented on June 10, 2024

感谢!

线上测试环境更新到0.3.12后没有再报过Interrupted system call的错误了。但是今天发现另外的一个问题。
image

client端稳定调用server端的rpc一段时间后,就会出现: TTransportException(message="Could not connect to ('192.168.160.61', 10000)", type=1)

服务端失联的情形,但是报异常的前后都有调用服务端的接口成功的情况。

问题,出现失联情形,thriftpy + thrift_connector的socket重连机制依赖我们使用thriftpy的应用层代码去人为设置重新请求服务端接口吗?

from thriftpy.

ethe avatar ethe commented on June 10, 2024

You can retry request manually.

from thriftpy.

lxl0928 avatar lxl0928 commented on June 10, 2024

Oh, thanks.

from thriftpy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.