DataDog / dd-trace-php

Datadog PHP Clients

Home Page:https://docs.datadoghq.com/tracing/setup/php

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: Instrumentation telemetry causing epoll error

marmichalski opened this issue · comments

Bug report

Instrumentation telemetry, enabled by default, is causing this kind of error on 2nd respawn of fpm child:

dd-fpm-php-fpm-1   | [16-Oct-2023 20:37:31] NOTICE: [pool www] child 33 exited with code 0 after 4.801731 seconds from start
dd-fpm-php-fpm-1   | [16-Oct-2023 20:37:31] ERROR: unable to read what child say: Bad file descriptor (9)
dd-fpm-php-fpm-1   | [16-Oct-2023 20:37:31] ERROR: epoll: unable to remove fd 12
dd-fpm-php-fpm-1   | [16-Oct-2023 20:37:31] NOTICE: [pool www] child 56 started

Disabling telemetry, in my case with env DD_INSTRUMENTATION_TELEMETRY_ENABLED=0 makes this error go away.
This happens in:

  • PHP 8.1(.24) (php:8.1-fpm-alpine3.16/17)
  • and 8.2(.11) (php:8.2-fpm-alpine3.17)

This does not happen in PHP 8.2(.5) (php:8.2-fpm-alpine3.16) 🤷

Happy to provide minimal docker compose setup if that helps, but it's quite easy to reproduce with minimal setup.

PHP version

8.1.24

Tracer or profiler version

0.92.1

Installed extensions

[PHP Modules]
Core
ctype
curl
date
ddappsec
ddtrace
dom
fileinfo
filter
ftp
hash
iconv
json
libxml
mbstring
mysqlnd
openssl
pcre
PDO
pdo_sqlite
Phar
posix
readline
Reflection
session
SimpleXML
sodium
SPL
sqlite3
standard
tokenizer
xml
xmlreader
xmlwriter
zlib

[Zend Modules]
ddappsec
ddtrace

Output of phpinfo()

No response

Upgrading from

0.79.0

Hey @marmichalski,

thanks for reporting, that bug doesn't always trigger, but just when the file descriptor does not get reused.
It's a bug in php-fpm with the handling of stderr being kept open (like when you fork and continue writing to stderr after the fpm process was terminated).

The issue will be fixed with the next release :-)