Skip to content
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
1 change: 1 addition & 0 deletions src/sentry/publish/sentry.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@
// Transport configuration
'transport_channel_size' => (int) env('SENTRY_TRANSPORT_CHANNEL_SIZE', 65535),
'transport_concurrent_limit' => (int) env('SENTRY_TRANSPORT_CONCURRENT_LIMIT', 1000),
'transport_timeout' => (float) env('SENTRY_TRANSPORT_TIMEOUT', -1),

'http_timeout' => (float) env('SENTRY_HTTP_TIMEOUT', 2.0),
];
11 changes: 10 additions & 1 deletion src/sentry/src/Transport/CoHttpTransport.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ class CoHttpTransport implements TransportInterface

protected int $channelSize = 65535;

protected float $timeout = -1;

public function __construct(
protected ContainerInterface $container,
) {
Expand All @@ -50,18 +52,25 @@ public function __construct(
if ($channelSize > 0) {
$this->channelSize = $channelSize;
}

$concurrentLimit = (int) $config->get('sentry.transport_concurrent_limit', 1000);
if ($concurrentLimit > 0) {
$this->concurrent = new Concurrent($concurrentLimit);
}

$timeout = (float) $config->get('sentry.transport_timeout', -1);
if ($timeout > 0) {
$this->timeout = $timeout;
}
}

public function send(Event $event): Result
{
$this->loop();

$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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.


return new Result(ResultStatus::success(), $event);
}
Expand Down
7 changes: 6 additions & 1 deletion src/tinker/src/Command/TinkerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,12 @@ public function handle()

$config = Configuration::fromInput($this->input);
$config->setUpdateCheck(Checker::NEVER);
$config->setUpdateManualCheck(ManualUpdaterChecker::NEVER);
if (
method_exists($config, 'setUpdateManualCheck')
&& class_exists(ManualUpdaterChecker::class)
) {
$config->setUpdateManualCheck(ManualUpdaterChecker::NEVER);
}
$config->setUsePcntl((bool) $this->config->get('tinker.usePcntl', false));
$config->getPresenter()->addCasters(
$this->getCasters()
Expand Down
Loading