Skip to content

bug: SDK must retry retriable grpc errors #61

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

Open
gfh31fgh2 opened this issue May 26, 2023 · 3 comments
Open

bug: SDK must retry retriable grpc errors #61

gfh31fgh2 opened this issue May 26, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@gfh31fgh2
Copy link

gfh31fgh2 commented May 26, 2023

Bug Report

YDB PHP SDK version:
latest

Environment
ubuntu18

Current behavior:

PHP Fatal error:  Uncaught YdbPlatform\Ydb\Exception: YDB Table DeleteSession (status code 14): failed to connect to all addresses; last error: 
UNKNOWN: ipv4:xx.xxx.xxx.xx:2135: tcp handshaker shutdown in /path/vendor/ydb-platform/ydb-php-sdk/src/Traits/RequestTrait.php:163#012
Stack trace:
#012#0 /path/vendor/ydb-platform/ydb-php-sdk/src/Traits/RequestTrait.php(87): YdbPlatform\Ydb\Session->checkStatus('Table', 'DeleteSession', Object(stdClass))
#012#1 /path/vendor/ydb-platform/ydb-php-sdk/src/Session.php(604): YdbPlatform\Ydb\Session->doRequest('Table', 'DeleteSession', Array)
#012#2 /path/vendor/ydb-platform/ydb-php-sdk/src/Session.php(152): YdbPlatform\Ydb\Session->request('DeleteSession', Array)
#012#3 /path/vendor/ydb-platform/ydb-php-sdk/src/Sessions/MemorySessionPool.php(23): YdbPlatform\Ydb\Session->delete()
#012#4 [internal function]: YdbPlatform\Ydb\Sessions\MemorySessionPool->__destruct()
#012#5 {main}#012  thrown in /path/vendor/ydb-platform/ydb-php-sdk/src/Traits/RequestTrait.php on line 163

Expected behavior:

php working more than 12 hours
and somehow we lost internet connection

Steps to reproduce:

php in background with simple select from ydb and disconnect of internet on it

Related code:

https://github.com/gfh31fgh2/ydb-php-simple-driver

@gfh31fgh2 gfh31fgh2 added the bug Something isn't working label May 26, 2023
@rekby
Copy link
Member

rekby commented May 29, 2023

Hello, thanks for the report.

It is "Unavailable" (code 14) error from grpc library. SDK must retry, but don't do that.
https://grpc.github.io/grpc/core/md_doc_statuscodes.html

The exception was in not client code and common retry function will not help there.

We need handle and retry the errors with client code retries and some handle for not client code error handle.
Retry or supress them (ok for destructor).

@rekby rekby changed the title bug: fatal SDK with disconnect bug: SDK must retry retriable grpc errors May 29, 2023
@gfh31fgh2
Copy link
Author

Hello, thanks for the report.

It is "Unavailable" (code 14) error from grpc library. SDK must retry, but don't do that. https://grpc.github.io/grpc/core/md_doc_statuscodes.html

The exception was in not client code and common retry function will not help there.

We need handle and retry the errors with client code retries and some handle for not client code error handle. Retry or supress them (ok for destructor).

так это возмжно сделать? или дело в библиотеке grpc и фикс там нужен?

@rekby
Copy link
Member

rekby commented May 31, 2023

Да, это возможно - php может ловить grpc-ошибки и может ретраить собственные обращения к серверу.

Со стороны grpc-библиотеки проблемы нет.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants