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

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

Open
mb0000 opened this issue Oct 15, 2021 · 0 comments
Open

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

mb0000 opened this issue Oct 15, 2021 · 0 comments

Comments

@mb0000
Copy link

mb0000 commented Oct 15, 2021

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant