Skip to content
2 changes: 1 addition & 1 deletion src/tarantool.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ static int __tarantool_connect(tarantool_object *t_obj) {
TSRMLS_FETCH();
tarantool_connection *obj = t_obj->obj;
int status = SUCCESS;
long count = TARANTOOL_G(retry_count);
long count = TARANTOOL_G(retry_count) + 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So in case of retry_count > 0 the real retry count will be retry_count + 1? I think it should be handled in some other way.

struct timespec sleep_time = {0};
double_to_ts(INI_FLT("retry_sleep"), &sleep_time);
char *err = NULL;
Expand Down
9 changes: 9 additions & 0 deletions test/CreateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,4 +211,13 @@ public function test_09_parse_uri_compatibility() {
$c->close();
}
}

public function test_10_zero_retry_exception() {
$t = static::connectTarantool();
$rc = ini_get('tarantool.retry_count');

ini_set('tarantool.retry_count', 0);
$this->assertEquals($t->ping(), true);
ini_set('tarantool.retry_count', $rc);
}
}