Skip to content

Commit 259ca6b

Browse files
masaori335zwoop
authored andcommitted
s3_auth: Fix assertion failure of TSActionCancel (#9329)
(cherry picked from commit 6ec45d5)
1 parent aa7fe17 commit 259ca6b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

plugins/s3_auth/s3_auth.cc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,18 @@ class S3Config
491491
_conf_rld_act = TSContScheduleOnPool(_conf_rld, delay * 1000, TS_THREAD_POOL_TASK);
492492
}
493493

494+
/**
495+
Clear _conf_rld_act if the event handler is handling the action
496+
*/
497+
void
498+
check_current_action(void *edata)
499+
{
500+
// Following what's TSContScheduleOnPool does before returning TSAction
501+
if (_conf_rld_act == ((TSAction)((uintptr_t)edata | 0x1))) {
502+
_conf_rld_act = nullptr;
503+
}
504+
}
505+
494506
ts::shared_mutex reload_mutex;
495507

496508
private:
@@ -1049,6 +1061,7 @@ config_reloader(TSCont cont, TSEvent event, void *edata)
10491061
{
10501062
std::unique_lock lock(s3->reload_mutex);
10511063
s3->copy_changes_from(file_config);
1064+
s3->check_current_action(edata);
10521065
}
10531066

10541067
if (s3->expiration() == 0) {

0 commit comments

Comments
 (0)