Skip to content

Commit 4567e20

Browse files
committed
No more assertion on 0 retries options
closes tarantoolgh-83
1 parent 13d2653 commit 4567e20

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/tarantool.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ static int __tarantool_connect(tarantool_object *t_obj) {
225225
TSRMLS_FETCH();
226226
tarantool_connection *obj = t_obj->obj;
227227
int status = SUCCESS;
228-
long count = TARANTOOL_G(retry_count);
228+
long count = TARANTOOL_G(retry_count) + 1;
229229
struct timespec sleep_time = {0};
230230
double_to_ts(INI_FLT("retry_sleep"), &sleep_time);
231231
char *err = NULL;

test/CreateTest.php

+9
Original file line numberDiff line numberDiff line change
@@ -211,4 +211,13 @@ public function test_09_parse_uri_compatibility() {
211211
$c->close();
212212
}
213213
}
214+
215+
public function test_10_zero_retry_exception() {
216+
$t = static::connectTarantool();
217+
$rc = ini_get('tarantool.retry_count');
218+
219+
ini_set('tarantool.retry_count', 0);
220+
$this->assertEquals($t->ping(), true);
221+
ini_set('tarantool.retry_count', $rc);
222+
}
214223
}

0 commit comments

Comments
 (0)