"accessControl" and probably sessions locking

Hi! I am looking some guidance or help in a issue than I am having…

I have a Yii 1 project where have auth implemented and in one of the controllers, called TestController I have the following

<?php

class TestController extends CController
{

    public function filters()
	{
		return array(
			'accessControl',
		);
	}

    public function accessRules()
	{
		return array(
			array('allow',
				'users'=>array('@'),
			),
			array('deny',
				'users'=>array('*'),
			),
		);
	}

	public function actionTest()
	{
        sleep(5);
        echo "OKi";
        return;
	}

}

test function only sleep for 5 sec.
When I execute X requests in parallel to this action, I am getting a rare behaviour, where each request waits for the previous one to proceed,
almost as if they were not running in parallel.
So if I execute 3 requests in parallel, the execution takes 15 seconds to end.

But if I comment the “accessControl” filter works fine.

I understand that this type of behavior is when one has a session lock problem.
Could be the problem? Or I’m missing something else?

Thanks in advance

Edit: I test same example using the hello world demo project and I get the same result

Not sure if related or not but if you define whitelist it means the rest are blocked.

For example all action in the controller will be allowed only if user is logged in. So no need to define deny rules!

public function behaviors()
{
    return [
        'access' => [
            'class' => AccessControl::class,
            'rules' => [
                [
                    //'actions' => ['specific-action'],
                    'allow' => true,
                    'roles' => ['@'],
                ],
            ],
        ]
    ];
}

Just realized it Yii1 :wink:

Yes, it Yii1

For now, I found a workaround closing the session in the “beforeAction” like this

    function beforeAction($action)
    {
        Yii::app()->session->close();
        return true;
    }

But not sure really, maybe Im playing with fire here and will get an unwanted behavior with sessions