Run $kernel->terminate after connection is closed in HHVM #658
Conversation
register_postsend_function($postSend); | ||
} | ||
else { | ||
$postSend(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would avoid defining a closure and calling it immediately for non-HHVM. Just put the $kernel->terminate($request, $response);
call directly.
@lmcd Have you tested this? Is it ready to be merged? |
I haven't been able to test it yet in a stable HHVM setup. Happy for someone else to do so. |
Hello, how can one test this ? |
@lmcd I've tested it just now on HipHop VM 3.6.2 (rel) and it works as expected - not any issues so far. @fabpot Should this be added to Symfony standard since a lot of folks are starting to use HHVM nowadays and actually it took me a while to recognize that fast_cgi_request_finish don't work on hhvm? Maybe for now it could be enough that this lines should be commented and say "uncomment this, if you're using hhvm" |
If the code works, let's see where this should be added in Symfony itself. |
We could close this!? If it’s really missing someone will notice, test it and this can be merged. |
As HHVM is not a priority for the core team, nobody is using it (we even discussed removing its official support in Symfony), someone using HHVM should finish this change so that we can merge it. In any case, it cannot be merge as is as this should be part of Symfony, not the standard edition. |
Closing this one as apparently nobody has the issue... or nobody uses HHVM and Symfony. |
In php-fpm, we can run cleanup code/blocking tasks after the HTTP connection is closed with
fastcgi_finish_request
. HHVM doesn't have this function, but it does have the counterpartregister_postsend_function
.See here:
https://github.com/facebook/hhvm/blob/master/hphp/doc/extension.new_functions
facebook/hhvm#1230
Note: haven't tested yet. Just putting it out there.