monicahq / monica

Personal CRM. Remember everything about your friends, family and business relationships.
https://beta.monicahq.com
GNU Affero General Public License v3.0
21.45k stars 2.14k forks source link

Stuck process in production #173

Closed djaiss closed 7 years ago

djaiss commented 7 years ago

This made the CPU go >97% for 5 hours.

I think it called SendReminderEmail with perhaps a user or something that didn't exist anymore.

{
   "displayName":"App\\Jobs\\SendReminderEmail",
   "job":"Illuminate\\Queue\\CallQueuedHandler@call",
   "maxTries":null,
   "timeout":null,
   "data":{
      "commandName":"App\\Jobs\\SendReminderEmail",
      "command":"O:26:\"App\\Jobs\\SendReminderEmail\":6:{s:11:\"\u0000*\u0000reminder\";O:45:\"Illuminate\\Contracts\\Database\\ModelIdentifier\":2:{s:5:\"class\";s:12:\"App\\Reminder\";s:2:\"id\";i:305;}s:7:\"\u0000*\u0000user\";O:45:\"Illuminate\\Contracts\\Database\\ModelIdentifier\":2:{s:5:\"class\";s:8:\"App\\User\";s:2:\"id\";i:765;}s:6:\"\u0000*\u0000job\";N;s:10:\"connection\";N;s:5:\"queue\";N;s:5:\"delay\";N;}"
   }
}
djaiss commented 7 years ago

I've cancelled this job at the moment, the CPU is back to normal. I need to investigate as soon as I can.

erdmenchen commented 7 years ago

There should be a max attempt variable and a timeout defined in the job class, so that this is not going to block a system.

See the Laravel docs: https://laravel.com/docs/5.4/queues#max-job-attempts-and-timeout

djaiss commented 7 years ago

@erdmenchen thanks! It's fixed now, all jobs now have a max attempt!

erdmenchen commented 7 years ago

@djaiss You are welcome, keep up the good work!

github-actions[bot] commented 3 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.