swoft-cloud / swoft

🚀 PHP Microservice Full Coroutine Framework
https://swoft.org
Apache License 2.0
5.58k stars 786 forks source link

Notice: Undefined index: spanid in #236

Closed zibber2015 closed 6 years ago

zibber2015 commented 6 years ago
Q A
Bug report? yes
Feature request? no
Swoft version 1.0
Swoole version 2.1.0 (by php --ri swoole)
PHP version 7.2 (by php -v)
Runtime environment Win10/Mac/CentOS 7/Ubuntu/Docker etc.

Details

Notice: Undefined index: spanid in /Users/*/Code/swoft/vendor/swoft/framework/src/Core/RequestContext.php on line 191

Describe what you are trying to achieve and what goes wrong. ws 启动报这个错

stelin commented 6 years ago

@zibber2015 swoole升级到最新版本试试!

inhere commented 6 years ago

这应该是调用记录日志导致的, log 时要收集上下文信息 - spanid (从 RequestContext 去拿的) 但是 ws 流程里 RequestContext 是空的

stelin commented 6 years ago

@inhere ws那边做一个默认值。

inhere commented 6 years ago

是 RequestContext 获取 spanid 那有问题,应该向 logid 那样 没有返回 0

stelin commented 6 years ago

是的,那优化

huangzhhui commented 6 years ago

看了下 SpanId 的获取是有先判断 isset 的,理应不会出现此 notice @inhere @stelin

inhere commented 6 years ago

是后面改了的

huangzhhui commented 6 years ago

那这个issue就close掉了