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]: curl_multi_exec() request failure on 0.94.0

Julian-Louis opened this issue Β· comments

Bug report

Hello, I installed this package yesterday (23 November 2023).
Every thing seems to be working fine except that some https://github.com/async-aws/dynamo-db-session requests appears as errors:
image

I took a look at the changelog of the installed release 0.94.0:
Screenshot 2023-11-24 at 15 53 01

I saw that a new feature (#2347) related to my error was implemented, so I tried with version 0.93.2and I don't have any https://github.com/async-aws/dynamo-db-session curls spans anymore. (It's normal, as the curl_multi_exec() tracer was not implemented)

More context

Screenshot 2023-11-24 at 16 14 14 image image

The HTTP request seems to be successful as http.status_code is 200
But as the curl.connect_time is 0, an exception is thrown (see commit)
I'm not sure to understand why curl.connect_time is 0, but I also don't understand why the span contain an error because the http request return a 200 status code

I hope I have been understood,
Feel free to ask me questions,
Thank you in advance

PHP version

8.1.25

Tracer or profiler version

0.94.0

Installed extensions

[PHP Modules]
bcmath
Core
ctype
curl
date
ddtrace
dom
fileinfo
filter
ftp
gd
hash
iconv
imagick
json
libxml
mbstring
mysqlnd
openssl
pcre
PDO
pdo_pgsql
pdo_sqlite
pgsql
Phar
posix
readline
Reflection
session
SimpleXML
soap
sodium
SPL
sqlite3
standard
tokenizer
xml
xmlreader
xmlwriter
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcache
ddtrace

Output of phpinfo()

No response

Upgrading from

0.93.2

I have a suspicion that curl reuses connections and thus curl.connect_time is a bad indicator (as it'll be 0 then). We'll have to verify, thanks for the report!

Hey @Julian-Louis!

Could you please try out this artifact (from this CI Job) and tell us if it helps with the behavior you're observing? It uses the http_code instead of relying on connect_time to detect curl request failures πŸ˜ƒ

PS: To use the artifact, you can replace the link of the installer by the one from the CI Job, which includes the changes πŸ‘

Hello, I've just tried the artifact and the problem seems to have been solved.
Do you need anything else?

Thanks for your prompt feedback @Julian-Louis πŸ˜ƒ

Since it appears to have solved the issue, we shouldn't need anything else from you. On my side, I'll do the PR, including this commit, and we'll possibly see for a hotfix πŸ‘

Thanks!

Thank you @PROFeNoM and @bwoebi !

I believe the solution implemented by @PROFeNoM and @bwoebi solved some cases but I am still seeing error traces with a non-zero connect time and dynamodb http code is 200 but the trace is displaying as errored. Would it be most appropriate to leave details here or to open a separate issue? What would be most helpful to your team in that report to determine if this is an ongoing issue or expected behavior?

Hello @sfong22, it seems that the fix is not yet release, so we should be waiting for the next release of this project (0.95.0).
You can look in the milestone (https://github.com/DataDog/dd-trace-php/milestone/161?closed=1).

Hi @sfong22 and @Julian-Louis,

I apologize for the delay. I am happy to let you know that version 0.95.0, including the required fix, has been released. You can find more information about this version on the release notes.

Thank you for your patience! πŸ˜ƒ

@PROFeNoM Thank you for the update!

I had compared the PR closure to the latest release but didn't actually check the release notes.

Thank you guys for your active monitoring of this repository and all your quick replies.