Skip to content

Another infinite loop #17

@diigits

Description

@diigits

If a page which is running parallel curl's loading is stopped by a client, that page will forever be stuck in a loop.

On line 159:
// Blocks until there's less than the specified number of requests outstanding
private function waitForOutstandingRequestsToDropBelow( $max ) {
while ( 1 ) {
$this->checkForCompletedRequests();
if ( count( $this->outstanding_requests )<$max )
break;

        usleep( 10000 );
    }
}

This will make the script stop on php-fpm and infinitely loop through the usleep( 10000 ).
I thought it was an issue with my server or php-fpm but I traced it back to this and made my server simply close the function if it can't do it after up to 20 seconds.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions