Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Processes are being terminated unexpectedly #52

Closed
petronetto opened this issue Jan 17, 2024 · 0 comments
Closed

Processes are being terminated unexpectedly #52

petronetto opened this issue Jan 17, 2024 · 0 comments

Comments

@petronetto
Copy link

petronetto commented Jan 17, 2024

I'm not sure if I'm doing something wrong or if it's a bug, but when I run the code below, more often than not one or more tasks don't finish.

Fork::new()
    ->run(
        function () {
            foreach (range(1, 1000) as $i) {
                usleep(rand(300, 3000));
            }

            echo "## Done #1" . PHP_EOL;
        },
        function () {
            foreach (range(1, 1000) as $i) {
                usleep(rand(300, 3000));
            }

            echo "## Done #2" . PHP_EOL;
        },
        function () {
            foreach (range(1, 1000) as $i) {
                usleep(rand(300, 3000));
            }

            echo "## Done #3" . PHP_EOL;
        },
    );

I'm running on a MacBook with M2 chip using Docker, below the Dockerfile I run the tests:

FROM php:8.2-cli-bookworm as base

# Install system dependencies
RUN set -e \
  && apt update \
  && apt install -y \
    git \
    unzip \
    libzip-dev \
    procps \
    autoconf \
    automake \
    gcc \
    make \
    g++ \
    coreutils \
    libtool \
    libssl-dev \
    libpq-dev \
    libicu-dev \
    libpcre3-dev \
    zlib1g-dev

# Install igbinary extension
RUN pecl install -o -f igbinary \
  && rm -rf /tmp/pear \
  && docker-php-ext-enable igbinary

# Install Redis extension with igbinary support
RUN cd /tmp && git clone https://github.com/phpredis/phpredis.git \
    && cd phpredis \
    && phpize \
    && ./configure --enable-redis-igbinary \
    && make && make install \
    && docker-php-ext-enable redis

# Install PHP extensions
RUN docker-php-ext-install \
    intl \
    posix \
    sockets \
    pcntl \
    zip

# Install Composer globally
RUN curl https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

# Copy PHP configuration files
COPY docker/php/config/common/* /usr/local/etc/php/conf.d/

# Add source code into docker image
COPY . /app

WORKDIR /app
@petronetto petronetto changed the title Process are being terminated unexpectedly Processes are being terminated unexpectedly Jan 17, 2024
@spatie spatie locked and limited conversation to collaborators Jan 18, 2024
@freekmurze freekmurze converted this issue into discussion #53 Jan 18, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant