Skip to content

Commit

Permalink
Merge pull request #70 from AikidoSec/cleanup-polling-goroutines-on-u…
Browse files Browse the repository at this point in the history
…ninit

Cleanup polling goroutines on uninit
  • Loading branch information
willem-delbare authored Nov 1, 2024
2 parents 380f5b9 + c239dec commit 738cf1c
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 8 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ jobs:
echo "$version is not installed."
fi
done
sudo apt-get update
sudo apt install libapache2-mod-php${{ matrix.php_version }}
sudo a2enmod php${{ matrix.php_version }}
php -i
Expand All @@ -403,6 +403,7 @@ jobs:
sudo dpkg -i ${{ env.AIKIDO_DEB }}/${{ env.AIKIDO_DEB }}
- name: Run CLI tests
if: matrix.os == 'ubuntu-latest'
run: |
cd ${{ github.workspace }}
php lib/php-extension/run-tests.php ./tests/cli
Expand All @@ -411,3 +412,12 @@ jobs:
run: |
cd tools
sudo python3 run_server_tests.py ../tests/server ../tests/testlib --server=${{ matrix.server }}
- name: Archive test artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-aikido-${{ env.AIKIDO_VERSION }}-${{ matrix.os }}-php-${{ matrix.php_version }}
if-no-files-found: ignore
path: |
${{ github.workspace }}/tests/cli/**/*.diff
3 changes: 2 additions & 1 deletion lib/agent/cloud/cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ func Init() {
}

func Uninit() {
utils.StopPollingRouting(HeartbeatRoutineChannel)
utils.StopPollingRoutine(HeartbeatRoutineChannel)
utils.StopPollingRoutine(ConfigPollingRoutineChannel)
}
2 changes: 1 addition & 1 deletion lib/agent/globals/constants.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package globals

const (
Version = "1.0.87"
Version = "1.0.88"
ConfigUpdatedAtMethod = "GET"
ConfigUpdatedAtAPI = "/config"
ConfigAPIMethod = "GET"
Expand Down
3 changes: 3 additions & 0 deletions lib/agent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ func AgentInit(initJson string) (initOk bool) {

//export AgentUninit
func AgentUninit() {
rate_limiting.Uninit()
cloud.Uninit()
grpc.Uninit()
config.Uninit()

log.Infof("Aikido Agent v%s unloaded!", globals.Version)
log.Uninit()
Expand Down
2 changes: 1 addition & 1 deletion lib/agent/rate_limiting/rate_limiting.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@ func Init() {
}

func Uninit() {
utils.StopPollingRouting(RateLimitingChannel)
utils.StopPollingRoutine(RateLimitingChannel)
}
2 changes: 1 addition & 1 deletion lib/agent/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func StartPollingRoutine(stopChan chan struct{}, ticker *time.Ticker, pollingFun
}()
}

func StopPollingRouting(stopChan chan struct{}) {
func StopPollingRoutine(stopChan chan struct{}) {
close(stopChan)
}

Expand Down
2 changes: 1 addition & 1 deletion lib/php-extension/include/php_aikido.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
extern zend_module_entry aikido_module_entry;
#define phpext_aikido_ptr &aikido_module_entry

#define PHP_AIKIDO_VERSION "1.0.87"
#define PHP_AIKIDO_VERSION "1.0.88"

#if defined(ZTS) && defined(COMPILE_DL_AIKIDO)
ZEND_TSRMLS_CACHE_EXTERN()
Expand Down
2 changes: 1 addition & 1 deletion lib/request-processor/globals/globals.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ var CloudConfig CloudConfigData
var CloudConfigMutex sync.Mutex

const (
Version = "1.0.87"
Version = "1.0.88"
)
2 changes: 1 addition & 1 deletion package/rpm/aikido.spec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: aikido-php-firewall
Version: 1.0.87
Version: 1.0.88
Release: 1
Summary: Aikido PHP Extension
License: GPL
Expand Down

0 comments on commit 738cf1c

Please sign in to comment.