Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用laravel-swoole以后,lumen报的错误日志无法跟踪,是否遇到类似情况。 #105

Closed
chinawilon opened this issue Jul 21, 2018 · 5 comments

Comments

@chinawilon
Copy link

Please answer these questions before submitting your issue. Thanks!

  1. Please provide your PHP and Swoole version. (php -v and php --ri swoole)

PHP 7.1.7
Swoole 4.0.1

  1. Please provide your Laravel/Lumen version.
    Lumen v5.6.4

  2. Which release version of this package are you using?
    dev-master

兄dei, 使用laravel-swoole以后,我的lumen日志里面偶尔会先这这样子的错误日志,打印request也是空的,无法知道它的请求来源, 是否有遇到过类似情况?

[2018-07-21 02:56:48] local.ERROR: #0 /mnt/hgfs/code/htdocs/microservice/union-gate/www/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(164): Laravel\Lumen\Application->handleDispatcherResponse(Array)
#1 /mnt/hgfs/code/htdocs/microservice/union-gate/www/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(413): Laravel\Lumen\Application->Laravel\Lumen\Concerns{closure}()
#2 /mnt/hgfs/code/htdocs/microservice/union-gate/www/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(166): Laravel\Lumen\Application->sendThroughPipeline(Array, Object(Closure))
#3 /mnt/hgfs/code/htdocs/microservice/union-gate/www/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(107): Laravel\Lumen\Application->dispatch(NULL)
#4 /mnt/hgfs/code/htdocs/microservice/union-gate/www/public/index.php(28): Laravel\Lumen\Application->run()
#5 {main}
[2018-07-21 02:56:53] local.ERROR: #0 /mnt/hgfs/code/htdocs/microservice/union-gate/www/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(164): Laravel\Lumen\Application->handleDispatcherResponse(Array)
#1 /mnt/hgfs/code/htdocs/microservice/union-gate/www/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(413): Laravel\Lumen\Application->Laravel\Lumen\Concerns{closure}()
#2 /mnt/hgfs/code/htdocs/microservice/union-gate/www/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(166): Laravel\Lumen\Application->sendThroughPipeline(Array, Object(Closure))
#3 /mnt/hgfs/code/htdocs/microservice/union-gate/www/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(107): Laravel\Lumen\Application->dispatch(NULL)
#4 /mnt/hgfs/code/htdocs/microservice/union-gate/www/public/index.php(28): Laravel\Lumen\Application->run()
#5 {main}

@albertcht
Copy link
Member

Hi @chinawilon ,

I can't tell your application is running on Swoole server based on these error logs. Are you sure these errors occurred in Swoole environment?

@chinawilon
Copy link
Author

thanks @albertcht

有个疑问一直很困惑,为什么当前执行的脚本初始化名称为manager进程,而不是master进程呢?

    /**
     * Initialize.
     */
    protected function initialize()
    {
        $this->setProcessName('manager process');

        $this->createTables();
        $this->prepareWebsocket();
        $this->createSwooleServer();
        $this->configureSwooleServer();
        $this->setSwooleServerListeners();
    }

@albertcht
Copy link
Member

Hi @chinawilon ,

Thanks for your reminding, the first line in initialize function is misplaced. The master process should be set in onStart and manager process should be set in onManagerStart. I'll correct it in the next release version.

@chinawilon
Copy link
Author

Hi @albertcht
However, it's indeed a manager process. When I tested it, I found that the process of the current script was the manager process. It's parent process becomes the master process, not the bash process.

@albertcht
Copy link
Member

Hi @chinawilon ,

Thanks for your report, but I think it's still better to place that in onManagerStart. That will be more clear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants