Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -265,11 +265,20 @@ jobs:
ports:
- 9042:9042

# 8.5 only, deliberately. This job LD_PRELOADs the ASan runtime into a
# stock (non-instrumented) setup-php binary, and PHP <= 8.4 dlopen()s
# shared extensions with RTLD_DEEPBIND, which the sanitizer runtime
# refuses to work with (google/sanitizers#611). With abort_on_error=1
# that is a SIGABRT during startup — on opcache.so, then mysqlnd.so, and
# ultimately on cassandra.so itself — so the 8.4 leg aborted before it
# could run a single test and had been permanently red while guarding
# nothing. It is not fixable by disabling individual extensions: the
# extension under test is itself a shared object. 8.5 does not pass
# RTLD_DEEPBIND and runs the full suite clean.
strategy:
fail-fast: false
matrix:
php:
- "8.4"
- "8.5"

steps:
Expand Down
10 changes: 2 additions & 8 deletions src/RetryPolicy/DefaultPolicy.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,11 @@ extern zend_object_handlers php_scylladb_retry_policy_default_policy_handlers;

PHP_SCYLLADB_API php_scylladb_retry_policy *php_scylladb_retry_policy_default_policy_instantiate(zval *dst)
{
zval val;

if (object_init_ex(&val, php_scylladb_retry_policy_default_policy_ce) == FAILURE) {
if (object_init_ex(dst, php_scylladb_retry_policy_default_policy_ce) == FAILURE) {
return nullptr;
}

ZVAL_OBJ(dst, Z_OBJ(val));

php_scylladb_retry_policy *obj = PHP_SCYLLADB_OBJ_FETCH(php_scylladb_retry_policy, Z_OBJ_P(dst));
obj->policy = cass_retry_policy_default_new();
return obj;
return PHP_SCYLLADB_OBJ_FETCH(php_scylladb_retry_policy, Z_OBJ_P(dst));
}


Expand Down
10 changes: 2 additions & 8 deletions src/RetryPolicy/DowngradingConsistency.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,11 @@ extern zend_object_handlers php_scylladb_retry_policy_downgrading_consistency_ha

PHP_SCYLLADB_API php_scylladb_retry_policy *php_scylladb_retry_policy_downgrading_consistency_instantiate(zval *dst)
{
zval val;

if (object_init_ex(&val, php_scylladb_retry_policy_default_policy_ce) == FAILURE) {
if (object_init_ex(dst, php_scylladb_retry_policy_downgrading_consistency_ce) == FAILURE) {
return nullptr;
}

ZVAL_OBJ(dst, Z_OBJ(val));

php_scylladb_retry_policy *obj = PHP_SCYLLADB_OBJ_FETCH(php_scylladb_retry_policy, Z_OBJ_P(dst));
obj->policy = cass_retry_policy_downgrading_consistency_new();
return obj;
return PHP_SCYLLADB_OBJ_FETCH(php_scylladb_retry_policy, Z_OBJ_P(dst));
}

void php_scylladb_retry_policy_downgrading_consistency_free(zend_object *object)
Expand Down
10 changes: 2 additions & 8 deletions src/RetryPolicy/Fallthrough.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,11 @@ extern zend_object_handlers php_scylladb_retry_policy_fallthrough_handlers;

PHP_SCYLLADB_API php_scylladb_retry_policy *php_scylladb_retry_policy_fallthrough_instantiate(zval *dst)
{
zval val;

if (object_init_ex(&val, php_scylladb_retry_policy_default_policy_ce) == FAILURE) {
if (object_init_ex(dst, php_scylladb_retry_policy_fallthrough_ce) == FAILURE) {
return nullptr;
}

ZVAL_OBJ(dst, Z_OBJ(val));

php_scylladb_retry_policy *obj = PHP_SCYLLADB_OBJ_FETCH(php_scylladb_retry_policy, Z_OBJ_P(dst));
obj->policy = cass_retry_policy_fallthrough_new();
return obj;
return PHP_SCYLLADB_OBJ_FETCH(php_scylladb_retry_policy, Z_OBJ_P(dst));
}

void php_scylladb_retry_policy_fallthrough_free(zend_object *object)
Expand Down
8 changes: 4 additions & 4 deletions src/RetryPolicy/Logging.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ php_scylladb_retry_policy_logging_new(zend_class_entry *ce)

PHP_SCYLLADB_API php_scylladb_retry_policy *php_scylladb_retry_policy_logging_instantiate(zval *dst, php_scylladb_retry_policy *retry_policy)
{
zval val;

if (object_init_ex(&val, php_scylladb_retry_policy_default_policy_ce) == FAILURE) {
if (retry_policy->policy == nullptr) {
return nullptr;
}

ZVAL_OBJ(dst, Z_OBJ(val));
if (object_init_ex(dst, php_scylladb_retry_policy_logging_ce) == FAILURE) {
return nullptr;
}

php_scylladb_retry_policy *obj = PHP_SCYLLADB_OBJ_FETCH(php_scylladb_retry_policy, Z_OBJ_P(dst));
obj->policy = cass_retry_policy_logging_new(retry_policy->policy);
Expand Down
Loading