Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix swoole server on request param. #100

Merged
merged 9 commits into from
Nov 9, 2023
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
29 changes: 16 additions & 13 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,23 @@ jobs:
- name: Composer install
run: composer install --working-dir=tests/php

# Build mixture for cargo test.
- name: Docker compose
if: matrix.os == 'ubuntu-20.04'
run: docker compose up -d
- name: Setup docker (missing on MacOS)
if: matrix.os == 'macos-12'
run: |
brew install docker
brew install docker-compose
mkdir -p ~/.docker/cli-plugins
ln -sfn $(brew --prefix)/opt/docker-compose/bin/docker-compose ~/.docker/cli-plugins/docker-compose

colima start

# For test containers to find the Colima socket
# https://github.com/abiosoft/colima/blob/main/docs/FAQ.md#cannot-connect-to-the-docker-daemon-at-unixvarrundockersock-is-the-docker-daemon-running
sudo ln -sf $HOME/.colima/default/docker.sock /var/run/docker.sock

# Build mixture for cargo test.
- name: Vagrant up for docker compose
if: matrix.os == 'macos-12'
run: vagrant up
- name: Docker compose
run: docker compose up -d --wait

# Try cargo test.
- name: Cargo test
Expand All @@ -198,14 +206,9 @@ jobs:

# Rebuild the mixture when cargo test failed.
- name: Docker compose restart
if: matrix.os == 'ubuntu-20.04' && steps.cargo-test-step.outcome != 'success'
if: steps.cargo-test-step.outcome != 'success'
run: docker compose restart

# Rebuild the mixture when cargo test failed.
- name: Vagrant reload for docker compose
if: matrix.os == 'macos-12' && steps.cargo-test-step.outcome != 'success'
run: vagrant reload

# Delay before retry.
- name: Delay
if: steps.cargo-test-step.outcome != 'success'
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ members = [

[package]
name = "skywalking-php"
version = "0.7.0"
version = "0.8.0-dev"
authors = ["Apache Software Foundation", "jmjoy <[email protected]>", "Yanlong He <[email protected]>"]
description = "Apache SkyWalking PHP Agent."
edition = "2021"
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to update this?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, we need to start a new version development.

Expand Down
38 changes: 0 additions & 38 deletions Vagrantfile

This file was deleted.

10 changes: 8 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ services:
- "12800:12800"
healthcheck:
test: [ "CMD", "curl", "http://127.0.0.1:12800/healthCheck" ]
interval: 5s
interval: 10s
timeout: 5s
retries: 10

mysql:
image: mysql:5.7.39
Expand All @@ -45,12 +46,17 @@ services:
- "11211:11211"

rabbitmq:
image: rabbitmq:3.11.13
image: rabbitmq:3.12.8
ports:
- "5672:5672"
environment:
- RABBITMQ_DEFAULT_USER=guest
- RABBITMQ_DEFAULT_PASS=guest
healthcheck:
test: [ "CMD", "rabbitmq-diagnostics", "check_running" ]
interval: 10s
timeout: 5s
retries: 10

mongo:
image: mongo:4.4.10
Expand Down
7 changes: 6 additions & 1 deletion src/plugin/plugin_swoole.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,12 @@ impl SwooleServerPlugin {
validate_num_args(execute_data, 2)?;

let on = execute_data.get_parameter(0);
if !on.as_z_str().map(|s| s == b"request").unwrap_or_default() {
if !on
.as_z_str()
.and_then(|s| s.to_str().ok())
.map(|s| s.to_lowercase() == "request")
.unwrap_or_default()
{
return Ok(Box::new(()));
}

Expand Down