GeniusesOfSymfony / WebSocketBundle

:part_alternation_mark: Websocket server for Symfony applications (powered by Ratchet), includes a Autobahn.JS based JavaScript client
MIT License
609 stars 140 forks source link

Warning: stream_select(): unable to select #448

Open krajcikondra opened 3 years ago

krajcikondra commented 3 years ago

Hi,

I had working chat in my web applicatin 2 months ago but something happend and now is my chat broken. I don`t know why.

When I run my websocket server

php bin/console gos:websocket:server

then websocket server running without error. When I connect via javascript client to websocket server evertything looks fine

[2021-10-18T13:25:28.876644+02:00] websocket.DEBUG: INSERT CLIENT 1229 {"token":{"Lexik\\Bundle\\JWTAuthenticationBundle\\Security\\Authentication\\Token\\JWTUserToken":"JWTUserToken(user=\"test@test.cz\", authenticated=true, roles=\"\")"},"username":"test@test.cz"} [] [2021-10-18T13:25:28.876702+02:00] websocket.INFO: test@test.cz connected {"connection_id":1229,"session_id":"1627219109616d59a8d5b60593063675","storage_id":"1229"} []

In log folder is no error but in Chrome -> network are no messages in websocket connection. I have ChatTopic.php and tried debug onSubscribe function but it is not called.

Some idea how debug why onSubscribe function is not called? I have version 3.7.2 of gos/web-socket-bundle

Edit: When I stop websocket server I get following warning:

php.DEBUG: Warning: stream_select(): unable to select [4]: Interrupted system call (max_fd=11) {"exception":{"Symfony\\Component\\ErrorHandler\\Exception\\SilencedErrorContext":{"severity":2,"file":"/var/www/html/vendor/react/event-loop/src/StreamSelectLoop.php","line":290,"trace":[{"file":"/var/www/html/vendor/react/event-loop/src/StreamSelectLoop.php","line":231,"function":"streamSelect","class":"React\\EventLoop\\StreamSelectLoop","type":"->"}],"count":1}}} []

mbabker commented 3 years ago

I doubt this is an issue within the bundle code. Without the full context, it seems like the react/event-loop is having issues reading from the chosen stream. Most likely, with the stream loop, this would be related to the php.ini configuration.

krajcikondra commented 3 years ago

Ok, this warning maybe not relate with my problem because my php.ini and versions of react/* libraries are same as 2 months ago when my chat works perfectelly

Have you some idea how find out why my ChatTopic::onSubscribe function was not called? I dont`t know where start debug :-(

clue commented 1 year ago

It looks like this should have been fixed via https://github.com/reactphp/event-loop/pull/245, perhaps you can take a look and confirm? 👍

For context: PHP prints a warning whenever a system call is interrupted by a signal. ReactPHP handles this just fine, so we've had to mute this unneeded warning. On top of this, the latest version now also makes sure no external error handlers such as Symfony's can "see" this muted warning.