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

Lumen Queue Issue #604

Closed
milon opened this issue Apr 12, 2017 · 3 comments
Closed

Lumen Queue Issue #604

milon opened this issue Apr 12, 2017 · 3 comments

Comments

@milon
Copy link

milon commented Apr 12, 2017

  • Lumen Version: 5.2.9
  • PHP Version: 5.5.9
  • Queue Driver: Redis

Description:

I am using lumen 5.2(because I have use php 5.5, the library I am using for connecting to SMPP works on 5.5) for an SMS sending server. I have 4 different queue priority, highest, high, default and low. I am using Redis as my queue driver.

Whenever a user requested for sending an SMS, it sends a Job to the queue based on priority. The job is really simple, just open a SMPP connection and send the SMS, then close the connection.

I am running the queue listener with supervisor. Here is the config of supervisor-

[program:send-sms]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/html/artisan queue:listen redis --tries=0 --queue=highest,high,default,low
autostart=true
autorestart=true
numprocs=6
redirect_stderr=true
stdout_logfile=/var/log/supervisor/send_sms.log

The system working fine for most of the time, but sometimes it stops dispatching job from queue. In the error log, I found this-

[2017-04-12 17:40:16] lumen.ERROR: exception 'ErrorException' with message 'Undefined index: job' in /var/www/html/vendor
/illuminate/queue/Jobs/Job.php:126
Stack trace:
#0 /var/www/html/vendor/illuminate/queue/Jobs/Job.php(126): Laravel\Lumen\Application->Laravel\Lumen\Concerns\{closure}(8
, 'Undefined index...', '/var/www/html/v...', 126, Array)
#1 /var/www/html/vendor/illuminate/queue/Jobs/RedisJob.php(50): Illuminate\Queue\Jobs\Job->resolveAndFire(Array)
#2 /var/www/html/vendor/illuminate/queue/Worker.php(213): Illuminate\Queue\Jobs\RedisJob->fire()
#3 /var/www/html/vendor/illuminate/queue/Worker.php(157): Illuminate\Queue\Worker->process('redis', Object(Illuminate\Que
ue\Jobs\RedisJob), '0', '0')
#4 /var/www/html/vendor/illuminate/queue/Console/WorkCommand.php(126): Illuminate\Queue\Worker->pop('redis', 'highest,hig
h,de...', '0', '3', '0')
#5 /var/www/html/vendor/illuminate/queue/Console/WorkCommand.php(79): Illuminate\Queue\Console\WorkCommand->runWorker('re
dis', 'highest,high,de...', '0', '128', false)
#6 [internal function]: Illuminate\Queue\Console\WorkCommand->fire()

I searched with the error, and found out this thread- laravel/framework#9555.

Then I log into redis console and after running KEYS *, I found a new key called queues:highest:delayed and if I delete it with with DEL command, then the queue started working fine agian. From where It comes. I don't use any delay() dispatch option anywhere in my code.

I also checked what this key contains. It's a sorted set and it contains value something like this-

{"id": "183428934728746524875623", "delay": 159}

So, it is failing while processing the job. From where this value comes from? How can I get rid of this?

@laurencei
Copy link

laurencei commented Apr 13, 2017

Not sure if related - but you said:

I have 4 different queue priority, highest, high, default and low

But your supervisor config is

--queue=high,default,low

So you are not even processing the highest queue tube? It should be:

--queue=highest,high,default,low

@milon
Copy link
Author

milon commented Apr 14, 2017

@laurencei, oww sorry. that was a typo. The config is actually-

--queue=highest,high,default,low

@driesvints
Copy link
Member

Closing this issue because it's already solved, old or not relevant anymore. Feel free to reply if you're still experiencing this issue.

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

No branches or pull requests

3 participants