Skip to content
This repository was archived by the owner on Oct 14, 2022. It is now read-only.
This repository was archived by the owner on Oct 14, 2022. It is now read-only.

Socket read exception handling - e.g. SOCKET_EAGAIN #37

@mb0000

Description

@mb0000

I notice in nesk/rialto/src/ProcessSupervisor.php / readNextProcessValue that $this->client->selectRead($readTimeout) is called, but its boolean return value is not saved and, therefore, used. In at least one instance (say a SOCKET_EAGAIN exception), it would be helpful to use that value to possibly try again (as suggested in the PHP constants reference manual for SOCKET_EAGAIN) - this is a very crude retry mechanism, I admit:

$okayToRead = $this->client->selectRead( $readTimeout );
if (! $okayToRead) $okayToRead = $this->client->selectRead( $readTimeout );

In the event that a subsequent client->read takes place, it wiil except for other causes, but is less likely to for what would have been a SOCKET_EAGAIN error.

Perhaps worth investigating further for a better solution than the simple retry I suggest above?

The situation that caused this for me was a very large number of puPHPeteer page->evaluate() calls happening in a short space of time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions