api-platform / demo

Demo app for the API Platform framework
https://demo.api-platform.com
MIT License
298 stars 197 forks source link

Any ideas how to fix locking problem? If I change docs and load locahost/docs multiple times it gets stuck till timeout #416

Closed juslintek closed 3 months ago

juslintek commented 3 months ago

API Platform version(s) affected: 3.3.6

Description
api/vendor/symfony/http-kernel/Kernel.php get stuck at line 420: if (!flock($lock, \LOCK_EX | \LOCK_NB, $wouldBlock) && !flock($lock, $wouldBlock ? \LOCK_SH : \LOCK_EX)) { no pun intended. But it happens after several changes to entity resources and requests to http://localhost/docs.

How to reproduce
Run this project remove VOLUME in order to get var accessible in local filesystem. And make changes to entities resources, then go to http://localhost/docs and see the timout in 30s happen.

vincentchalamon commented 3 months ago

Hi @juslintek,

Can you produce a reproducer please? You can fork this project and create a reproducer with your bug, so I can investigate on it.

juslintek commented 3 months ago

Hey, I do not need to create reproducer, problem exists on current latest main branch :-) Just run it in dev mode. Seems like frankenphp --watch spins up lots of coroutine processes which start to lock each other from themselves. And that is mostly caused by any changes that happens with docs. You can add on entity resource description attribute and type in "Here I am". And reload https://localhosts/docs and vuola.

Might be Mac M2 and VirtuoFS issue, haven't tested on other settings.

dunglas commented 3 months ago

Likely the same issue as https://github.com/dunglas/frankenphp/issues/886 and https://github.com/dunglas/symfony-docker/issues/641

vincentchalamon commented 3 months ago

Closing as not related to this repository, please follow the issues linked above for more information about this bug.