bwoebi
Repos
42
Followers
149
Following
6

The PHP Interpreter

C
34369
7008

C
175
28

A non-blocking concurrency framework for PHP applications. 🐘

3707
218

A non-blocking HTTP application, WebSocket and file server for PHP based on Amp.

46
7

A non-blocking HTTP application server for PHP based on Amp.

1201
86

Async MySQL client for PHP based on Amp.

286
50

Events

Add fiber support

Signed-off-by: Bob Weinand bob.weinand@datadoghq.com

Created at 1 day ago
pull request opened
Implement fibers

Description

Stacked on top of the #1746 span stacks PR.

Quite lightweight, but adding crash safety on bailout on PHP 8.1.

Readiness checklist

  • [ ] (only for Members) Changelog has been added to the release document.
  • [x] Tests added for this feature/bug.

Reviewer checklist

  • [ ] Appropriate labels assigned.
  • [ ] Milestone is set.
  • [ ] Changelog has been added to the release document. For community contributors the reviewer is in charge of this task.
Created at 1 day ago
create branch
bwoebi create branch bob/fibers
Created at 1 day ago
issue comment
Return immediately when FD_SETSIZE is exceeded

Fine by me :-)

Created at 1 day ago

Fix trace tag propagation

Signed-off-by: Bob Weinand bob.weinand@datadoghq.com

Created at 2 days ago
issue comment
Select the first of month as day when creating a date without day

Yup, it works, if you specify it explicitly. The problem is just that, as far as I know, nearly nobody is aware of it, and people will always run into the issue.

Created at 2 days ago
opened issue
Select the first of month as day when creating a date without day

Description

While it is consistent and logical, I've never seen a case where using the current day of month was the desired behaviour when selecting only a month (or year and month). It just ends up always being a big footgun, exploding in someones production code after 1-60 days.

What nearly everyone wants, when he writes that code, is a day within that month.

So that code like:

$dateTime = DateTime::createFromFormat('Y-m', '2022-02');
print $dateTime->format('Y-m') . PHP_EOL;

will indeed return 2022-02, independently of the current day.

If you actually want to preserve the behaviour, it is trivial by being explicit as in writing '2022-02-' . date('d').

I'm essentially asking here - as a feature for a future version 8.2 or 8.3+ - this behaviour being changed to be less surprising to developers, and in particular idempotent relative to the current date.

I'm aware this is special casing, but a special case giving a better developer experience.

Created at 2 days ago

Fix hook leak with invalid hook installation

Signed-off-by: Bob Weinand bob.weinand@datadoghq.com

Fix GC crashes with PHP 7.3 cycle collector

PHP 7.3 (and older) cycle collector looks at references: if rc unchanged, then it's freed, unless it's referenced via get_gc of another garbage being removed.

We essentially have two choices: a) export the closed spans as get_gc b) incref the closed spans

We opt for b), because a) just adds overhead in cycle collection.

And fixup broken logic with nested flushing.

Signed-off-by: Bob Weinand bob.weinand@datadoghq.com

Created at 2 days ago

Implement span stacks

Signed-off-by: Bob Weinand bob.weinand@datadoghq.com

Fix hook leak with invalid hook installation

Signed-off-by: Bob Weinand bob.weinand@datadoghq.com

Created at 3 days ago

Implement span stacks

Signed-off-by: Bob Weinand bob.weinand@datadoghq.com

Created at 3 days ago

Implement span stacks

Signed-off-by: Bob Weinand bob.weinand@datadoghq.com

Created at 4 days ago

Implement span stacks

Signed-off-by: Bob Weinand bob.weinand@datadoghq.com

Created at 4 days ago

Implement span stacks

Signed-off-by: Bob Weinand bob.weinand@datadoghq.com

Created at 4 days ago

Implement span stacks

Signed-off-by: Bob Weinand bob.weinand@datadoghq.com

Created at 4 days ago

Implement span stacks

Signed-off-by: Bob Weinand bob.weinand@datadoghq.com

Created at 4 days ago

Implement span stacks

Signed-off-by: Bob Weinand bob.weinand@datadoghq.com

Created at 4 days ago

Implement span stacks

Signed-off-by: Bob Weinand bob.weinand@datadoghq.com

Created at 4 days ago

Implement span stacks

Signed-off-by: Bob Weinand bob.weinand@datadoghq.com

Created at 5 days ago

Handle non-binaries in installer (#1743)

[profiling] Match the service names of the tracer when unset or empty (#1733)

If DD_SERVICE is unset or empty, then the tracer defaults the service name to one of these:

  • the script name, aka argv[0]
  • cli.command
  • web.request

The profiler now does the same which should result in fewer services named unnamed-php-service.

[profiling] Avoid crashing when pcntl_fork is called (#1745)

This replaces the global profiler object in the child process with None, and sets profiling_enabled to false. This leaks some memory at the expense of crashing less.

However, it's still possible to have issues, for instance if a thread in the process holds a lock at the time of the fork. So there is further work to either synchronize such that no locks are held, or to clean up all that stuff before the fork, and make it again after.

  • Bump minor version

  • Add args to run-tests to show error info

  • Run x-profiling tests on PHP 8.1 too

Update AppSec to v0.4.2 (#1747)

Update AppSec to v0.4.3 (#1748)

Fix behaviour of return false in trace hooks (#1749)

Previously return false was ignored in any trace hook, but the first one.

Signed-off-by: Bob Weinand bob.weinand@datadoghq.com

Add span stack tests

Signed-off-by: Bob Weinand bob.weinand@datadoghq.com

Fix span stack tests

Signed-off-by: Bob Weinand bob.weinand@datadoghq.com

Implement span stacks

Signed-off-by: Bob Weinand bob.weinand@datadoghq.com

Created at 5 days ago
issue comment
Return immediately when FD_SETSIZE is exceeded

The other option is to just return when an exception is thrown or when the fd set is empty. I.e. mirroring current behaviour, except for the specific reported edge cases.

But I'm not sure whether that's better.

Created at 5 days ago
issue comment
AGENT_REQUEST_BODY_LIMIT is hard coded and no longer valid

Hey @pgibson1-godaddy,

your understanding is correct, however the current source of truth is https://github.com/DataDog/dd-trace-php/blob/873e48296ccdd4bd1324d417b3db82794367d66f/ext/comms_php.h#L10

We will look at adding support for configuration here.

Created at 5 days ago