feat(sentry): add transport push timeout config#1074
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
* feat(sentry): add transport push timeout config * format * fix --------- Co-Authored-By: Deeka Wong <8337659+huangdijia@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: df481587ec
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| $chan = $this->chan; | ||
| $chan?->push($event); | ||
| // push event to channel, if timeout is set, it will wait for the specified time | ||
| $chan?->push($event, $this->timeout); |
There was a problem hiding this comment.
Return failure when enqueue times out
When sentry.transport_timeout is set to a positive value and the bounded transport channel stays full for that interval, Hyperf\Engine\Channel::push() returns false; this result is ignored here and send() still reports ResultStatus::success(). That means the new timeout path can silently drop Sentry events while the SDK/callers see a successful send, so the enqueue result should be checked and surfaced as a failed result or logged.
Useful? React with 👍 / 👎.
Summary
sentry.transport_timeoutconfiguration for Sentry coroutine transport.push()when enqueueing events.Changes
SENTRY_TRANSPORT_TIMEOUTwith default-1.CoHttpTransportand use them for channel push waits.Test Plan
vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php --dry-run --diff --ansi src/sentry/publish/sentry.php src/sentry/src/Transport/CoHttpTransport.phpvendor/bin/pest tests/SentryRisks
SENTRY_TRANSPORT_TIMEOUTis configured with a positive value.