You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2017-05-04 09:23:58

ITCPOLAND
Guest
Registered: 2015-12-10
Posts: 15

Issue with Mailgate and cron

Hello all.

I have some issue with mailgate and cron. I found in cron.log that sometimes after mailgate acction starts cron cannot use database (log in cron.log is 'Can't get DB lock'). Mailgate cannot collect mails form mailbox or hangs up.

If someone had similar problem or maybe someone know how to fix it?

Offline

#2 2017-05-09 19:29:37

yllen
GLPI-DEV
From: Sillery (51)
Registered: 2008-01-14
Posts: 13,879

Re: Issue with Mailgate and cron

Version of GLPI used?
Number of automatic tasks launched in the same time (in GLPI configuration)?
Version of MySQL or MariaDB?


CentOS 6.5 - CentOS 7
PHP 5.6 - PHP 7 - MySQL 5.6  + APC + oOPcache
GLPI from 0.72 to dev version
Certifiée ITIL (ITV2F, ITILF, ITILOSA)

Offline

#3 2017-05-10 10:39:58

ITCPOLAND
Guest
Registered: 2015-12-10
Posts: 15

Re: Issue with Mailgate and cron

yllen wrote:

Version of GLPI used?
Number of automatic tasks launched in the same time (in GLPI configuration)?
Version of MySQL or MariaDB?

Version 0.90.5
Maximal number of automatic actions (run by CLI) 7
MySQLd server version: 5.6.35-2.el7

Offline

#4 2017-05-11 18:29:11

yllen
GLPI-DEV
From: Sillery (51)
Registered: 2008-01-14
Posts: 13,879

Re: Issue with Mailgate and cron

When the cron freeze, is your database active?
Can you create an item in GLPI when cron is HS?


CentOS 6.5 - CentOS 7
PHP 5.6 - PHP 7 - MySQL 5.6  + APC + oOPcache
GLPI from 0.72 to dev version
Certifiée ITIL (ITV2F, ITILF, ITILOSA)

Offline

#5 2017-05-12 11:02:07

ITCPOLAND
Guest
Registered: 2015-12-10
Posts: 15

Re: Issue with Mailgate and cron

Database is on the same machine as GLPI. In logs there is no information about issues with databes.
What is HS for Crone?

Offline

#6 2017-05-22 13:08:20

yllen
GLPI-DEV
From: Sillery (51)
Registered: 2008-01-14
Posts: 13,879

Re: Issue with Mailgate and cron

Your automatics tasks are in GLPI or LI mode?


CentOS 6.5 - CentOS 7
PHP 5.6 - PHP 7 - MySQL 5.6  + APC + oOPcache
GLPI from 0.72 to dev version
Certifiée ITIL (ITV2F, ITILF, ITILOSA)

Offline

#7 2017-05-22 13:24:30

ITCPOLAND
Guest
Registered: 2015-12-10
Posts: 15

Re: Issue with Mailgate and cron

CLI mode

Offline

#8 2017-06-12 19:29:12

thiago.rodrigues
Guest
Registered: 2017-03-17
Posts: 8

Re: Issue with Mailgate and cron

Same issue here... Anyone?

Offline

#9 2017-10-05 12:12:35

grajek
Guest
Registered: 2015-03-16
Posts: 48

Re: Issue with Mailgate and cron

Hello!
I have this problem since migrating from 9.0.5 to 9.16. I believe this is because before every state change of automatic actions, GLPI locks table glpi_crontasks and releases this lock after state change. What I think happens is:
1. first task starts: locks table, updates status, unlocks table
2. second task starts: locks table, updates status, unlocks table
3. one of the tasks ends: locks table,  and...
4. other task ends: tries to lock table, but it's already locked... writes error into cron.log, ends without updating status

I've changed most of my tables engine to INNODB (unsupported, I know, but it works) and I'm wondering if it is safe to remove this locking mechanism from crontask class and replace it with row lock... Unlike MYISAM, there is no need to lock a table to do update, because you can do it on row level in INNODB. I think this would prevent this scenario from happening.
As of now, I'm using this script: glpi/scripts/unlock_tasks.php in cron, but I had to modify it a bit: I removed "$cycle *  `frequency`" and replaced it with "frequency" only, because it was too restrictive for me.


GLPI 9.1.6 Debian

Offline

Board footer

Powered by FluxBB