View Issue Details

IDProjectCategoryView StatusLast Update
0016507mantisbtbugtrackerpublic2014-12-08 02:07
ReporterrombertAssigned Todregad 
PriorityhighSeveritycrashReproducibilityalways
Status closedResolutionfixed 
Product Version1.3.0dev 
Target Version1.3.0-beta.1Fixed in Version 
Summary0016507: Adding a bugnote causes a script timeout
Description

Adding a bugnote causes the script to timeout after 30 seconds:

[Fri Oct 18 00:37:24 2013] [error] [client 127.0.0.1] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /mnt/md/robert/git/mantisbt/library/adodb/adodb.inc.php on line 3565, referer: http://localhost/~robert/mantisbt/view.php?id=2615
[Fri Oct 18 00:37:24 2013] [error] [client 127.0.0.1] PHP Stack trace:, referer: http://localhost/~robert/mantisbt/view.php?id=2615
[Fri Oct 18 00:37:24 2013] [error] [client 127.0.0.1] PHP   1. {main}() /mnt/md/robert/git/mantisbt/bugnote_add.php:0, referer: http://localhost/~robert/mantisbt/view.php?id=2615
[Fri Oct 18 00:37:24 2013] [error] [client 127.0.0.1] PHP   2. bugnote_add() /mnt/md/robert/git/mantisbt/bugnote_add.php:79, referer: http://localhost/~robert/mantisbt/view.php?id=2615
[Fri Oct 18 00:37:24 2013] [error] [client 127.0.0.1] PHP   3. email_bugnote_add() /mnt/md/robert/git/mantisbt/core/bugnote_api.php:270, referer: http://localhost/~robert/mantisbt/view.php?id=2615
[Fri Oct 18 00:37:24 2013] [error] [client 127.0.0.1] PHP   4. email_generic() /mnt/md/robert/git/mantisbt/core/email_api.php:754, referer: http://localhost/~robert/mantisbt/view.php?id=2615
[Fri Oct 18 00:37:24 2013] [error] [client 127.0.0.1] PHP   5. email_collect_recipients() /mnt/md/robert/git/mantisbt/core/email_api.php:580, referer: http://localhost/~robert/mantisbt/view.php?id=2615
[Fri Oct 18 00:37:24 2013] [error] [client 127.0.0.1] PHP   6. db_result() /mnt/md/robert/git/mantisbt/core/email_api.php:287, referer: http://localhost/~robert/mantisbt/view.php?id=2615
[Fri Oct 18 00:37:24 2013] [error] [client 127.0.0.1] PHP   7. db_num_rows() /mnt/md/robert/git/mantisbt/core/database_api.php:548, referer: http://localhost/~robert/mantisbt/view.php?id=2615
[Fri Oct 18 00:37:24 2013] [error] [client 127.0.0.1] PHP   8. ADORecordSet->RecordCount() /mnt/md/robert/git/mantisbt/core/database_api.php:448, referer: http://localhost/~robert/mantisbt/view.php?id=2615

Tested at revision 0deb3b6119403279cc22960d375b340450c9e9df.

TagsNo tags attached.

Relationships

Activities

rombert

rombert

2013-10-17 18:05

developer   ~0038293

Also causes failures in the Travis CI build, see https://travis-ci.org/mantisbt/mantisbt/jobs/12691317

dregad

dregad

2013-10-18 03:37

developer   ~0038295

I am not able to reproduce this on my dev box unfortunately.

Furthermore, I don't understand how the erroring statement which, based on the error log you posted, is just returning a class property [1] could possibly cause a PHP timeout.

Maybe the root cause is in the email_api ?

[1] https://github.com/mantisbt/ADOdb/blob/mantis-1.3/adodb.inc.php#L3565

dregad

dregad

2013-10-18 03:43

developer   ~0038297

Looking at the Travis CI build history, the first occurence of the timeout error out is with build 155 - commit fbd6540

It turns out that this commit modified email_api.php so maybe there's something wrong with that change. I'll have a look.

atrol

atrol

2013-10-18 03:51

developer   ~0038298

I got the same problem.
Setting $g_enable_email_notification = OFF; fixed it for me.
Maybe we should change the default in config_defaults_inc.php

rombert

rombert

2013-10-18 03:56

developer   ~0038299

I think the current default is fine, the problem is with whatever broke notifications.

atrol

atrol

2013-10-18 04:05

developer   ~0038300

The current default would be fine if we had implemented part b) of 0016423
But that's another story.

You are right that it should work also with setting ON as it works also in master-1.2.x with this setting.

dregad

dregad

2013-10-18 04:14

developer   ~0038301

Thanks Roland for pointing that one out, I've got a "standard" custom config_inc.php which I used for my local tests where this is set to OFF, that explains it probably.

Now that I know the root cause I think I know where to look.

dregad

dregad

2013-10-18 05:03

developer   ~0038304

Infinite loop @ https://github.com/mantisbt/mantisbt/blob/master/core/email_api.php#L287

dregad

dregad

2013-10-18 06:01

developer   ~0038305

I found 2 occurences of a while loop using db_result to retrieve data instead of db_fetch_array.

govind

govind

2013-12-01 22:04

reporter   ~0038705

sdfgdf

govind

govind

2013-12-01 22:05

reporter   ~0038736

xdfjghjgh

Related Changesets

MantisBT: master dc3266a4

2013-10-18 06:04:18

dregad

Details Diff
Fix infinite loop when adding email recipients

Commit fbd654083f061fcfcc8dc7229953cc44737889fa introduced a regression
preventing the addition of bugnotes as a PHP Fatal error: Maximum
execution time of 30 seconds exceeded was triggered.

Fixes 0016507
mod - core/email_api.php Diff File

Issue History

Date Modified Username Field Change
2013-10-17 17:47 rombert New Issue
2013-10-17 18:05 rombert Note Added: 0038293
2013-10-17 18:05 rombert Status new => confirmed
2013-10-18 03:37 dregad Note Added: 0038295
2013-10-18 03:43 dregad Note Added: 0038297
2013-10-18 03:51 atrol Note Added: 0038298
2013-10-18 03:56 rombert Note Added: 0038299
2013-10-18 04:05 atrol Note Added: 0038300
2013-10-18 04:14 dregad Note Added: 0038301
2013-10-18 05:03 dregad Note Added: 0038304
2013-10-18 05:03 dregad Assigned To => dregad
2013-10-18 05:03 dregad Status confirmed => assigned
2013-10-18 06:01 dregad Note Added: 0038305
2013-10-18 06:01 dregad Target Version 1.3.0-beta.1 => 1.3.0dev
2013-10-18 06:05 dregad Changeset attached => MantisBT master dc3266a4
2013-10-18 06:05 dregad Status assigned => resolved
2013-10-18 06:05 dregad Resolution open => fixed
2013-10-18 06:05 dregad Fixed in Version => 1.3.0dev
2013-10-18 06:10 dregad Product Version => 1.3.0dev
2013-10-18 17:22 atrol Fixed in Version 1.3.0dev => 1.3.0-beta.1
2013-10-18 17:22 atrol Target Version 1.3.0dev => 1.3.0-beta.1
2013-12-01 22:04 govind Note Added: 0038705
2013-12-01 22:05 govind Note Added: 0038736
2014-11-10 11:09 vboctor Fixed in Version 1.3.0-beta.1 =>
2014-12-08 02:07 atrol Status resolved => closed