Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sock files are piling up in tmp folder. They are not getting cleared up automatically. #183

Closed
MindGamer7 opened this issue Jul 27, 2023 · 2 comments

Comments

@MindGamer7
Copy link

I am using simple code similar to as follow as shown in AMPHP parallel example. However, sock files in tmp folder keep piling up
`$executions = [];
foreach ($urls as $url) {
// FetchTask is just an example, you'll have to implement
// the Task interface for your task.
$executions[$url] = Worker\submit(new FetchTask($url));
}

// Each submission returns an Execution instance to allow two-way
// communication with a task. Here we're only interested in the
// task result, so we use the Future from Execution::getFuture()
$responses = Future\await(array_map(
fn (Worker\Execution $e) => $e->getFuture(),
$executions,
));

class FetchTask implements Task
{
public function __construct(
private readonly string $url,
) {
}

public function run(Channel $channel, Cancellation $cancellation): string
{
    return file_get_contents($this->url); // Example blocking function
}

}
`
The code runs fine but sock files are not cleared in system tmp folder. Please any suggestion what need to be done?

@trowski
Copy link
Member

trowski commented Nov 26, 2023

Thanks for pointing out this issue! The temporary file was removed if the IPC socket was explicitly closed, but was not removed if the IPC socket was closed through destruction.

@medy36
Copy link

medy36 commented May 23, 2024

Hello @trowski, i had encountered the issue of .socket files left in server /tmp/ folder, which was successfully resolved after your fix in >2.2.4.

Today after deploying an ASYNC work doing the same parallel work, I have found that the sockets are again still left in the /tmp/ folder.

I am using 2.2.9 parallel, the sync method is freeing the /tmp/ from socket but the Async does leave the .socket files.

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

No branches or pull requests

3 participants