Uploaded image for project: 'Couchbase PHP client library'
  1. Couchbase PHP client library
  2. PCBC-984

Child process hangging on exit() call

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 4.2.1
    • 4.2.0
    • extension
    • None
    • Mac OS aarch46 14.4 - PHP 8.3.4
      Alma Linux 9.3 aarch64 - PHP 8.3.4
    • 1
    • SDK12: Scp Fnc, FIT, Misc, SDK14: CLoE + Others

    Description

      Hi

      The following code is working for forking proccess useing extention versions 4.0 and 4.1, due to the change in the connection string.

      chdir(__DIR__);
      require_once __DIR__ . '/../vendor/autoload.php';
       
      use \Couchbase\ClusterOptions;
      use \Couchbase\Cluster;
       
      $username         = 'user';
      $password         = 'password';
      $connectionString = 'couchbase://10.10.10.10';
      $bucketName       = 'testing';
      $scopeName        = '_default';
      $collectionName   = '_default';
       
       
      $clusterOpts = new ClusterOptions();
      $clusterOpts->credentials($username, $password);
       
      $couchbase  = new Cluster($connectionString. '?ppid=' . posix_getppid(), $clusterOpts);
      $bucket     = $couchbase->bucket($bucketName);
      $scope      = $bucket->scope($scopeName);
      $collection = $scope->collection($collectionName);
       
      $result = $collection->upsert('test-key', [time(), 'some data']);
       
      $data = $collection->get('test-key')->content();
       
      print_r($data);
       
      $processId = pcntl_fork();
      if ($processId < 0) {
          // cleanup using posix_kill & pcntl_wait
          throw new RuntimeException('pcntl_fork failed.');
      } elseif ($processId === 0) {
          $couchbase  = new Cluster($connectionString. '?ppid=' . posix_getppid(), $clusterOpts);
          $bucket     = $couchbase->bucket($bucketName);
          $scope      = $bucket->scope($scopeName);
          $collection = $scope->collection($collectionName);
       
          $data = $collection->get('test-key')->content();
          print_r($data);
          exit(); // <-- locks up and never exits
      } else {
          pcntl_wait($status);
          // WE ARE IN THE PARENT
          echo "parent\r\n";
      } 

       

      It is now locking up on the child exit() call, I would guess it has somthing to to do with https://issues.couchbase.com/browse/PCBC-964 which could of introduced a blocking call into the extention shutdown, but you would have a better idea than me of the problem.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              avsej Sergey Avseyev
              Steven Steven Lewis
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty