roadrunner-server / roadrunner

🤯 High-performance PHP application server, process manager written in Go and powered with plugins
https://docs.roadrunner.dev
MIT License
7.92k stars 411 forks source link

Connections hangs under Windows #83

Closed AlexPravdin closed 5 years ago

AlexPravdin commented 5 years ago

Windows 10 PHP 7.3.0 RR 1.3.0

Clean Symfony 4.2 Skeleton app. Worker script is copied from here: https://github.com/spiral/roadrunner/wiki/Symfony-Framework with little path-related changes. RR config:

# defines environment variables for all underlying php processes
env:
  key: value

http:
  address: :8090
  workers:
    command: "php src/RRBootstrap.php"
    pool:
      numWorkers: 4
      # maximum jobs per worker, 0 - unlimited.
      maxJobs:  0
      # for how long worker is allowed to be bootstrapped.
      allocateTimeout: 60
      # amount of time given to worker to gracefully destruct itself.
      destroyTimeout:  60

  # max POST request size, including file uploads in MB.
  maxRequest: 50

# static file serving. remove this section to disable static file serving.
static:
  # root directory for static file (http would not serve .php and .htaccess files).
  dir:   "public"

  # list of extensions for forbid for serving.
  forbid: [".php", ".htaccess"]

Console rr output:

>rr\rr serve -v -d
DEBU[0000] [rpc]: started
DEBU[0000] [http]: started

When I connect to the 8081 port, connections hangs and never ends. No response, no timeout errors. Right now I'm observing a 30-minute conection.

It seems there must be at least a timeout error. And I want to know how to debug and solve such a problem?

AlexPravdin commented 5 years ago

Also I have a lot of questions about its operation caused by lack of documentation.

wolfy-j commented 5 years ago

Per your config, you listen on 8090 port. You can ask your questions as separate GitHub issues so we can clarify missing information in Wiki.

AlexPravdin commented 5 years ago

Sorry, I was mistyping. I'm connecting to 8090 port.

wolfy-j commented 5 years ago

Have you tried to request any static file? Have you tired to use simpler hello world worker? Windows firewall sometimes will block ports without providing any feedback loop, this can not be checked on RR end. Try to use different port maybe, or make sure that RR is allowed to serve thought firewall. What happens when you try to stop rr, does it ends without any warnings?

Hope it helps, unfortunately, Windows machines can be painful to debug.

AlexPravdin commented 5 years ago

This is my fault. Placing the RR worker into the src directory caused this default Symfony's config in action:

services:
    App\:
        resource: '../src/*'
        exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'

So Symfony was including worker file on startup and worker was tried to connect to itself. Commenting this config or removing worker file from the src folder solved this problem.

wolfy-j commented 5 years ago

Perfect :)