MantisBT

View Issue Details Jump to Notes ] Wiki ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0016507mantisbtbugtrackerpublic2013-10-17 17:472013-12-01 22:05
Reporterrombert 
Assigned Todregad 
PriorityhighSeveritycrashReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version1.3.0dev 
Target Version1.3.xFixed in Version1.3.x 
Summary0016507: Adding a bugnote causes a script timeout
DescriptionAdding 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.
Attached Files

- Relationships

-  Notes
User avatar (0038293)
rombert (developer)
2013-10-17 18:05

Also causes failures in the Travis CI build, see https://travis-ci.org/mantisbt/mantisbt/jobs/12691317 [^]
User avatar (0038295)
dregad (developer)
2013-10-18 03:37

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 [^]
User avatar (0038297)
dregad (developer)
2013-10-18 03:43

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.
User avatar (0038298)
atrol (developer)
2013-10-18 03:51

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
User avatar (0038299)
rombert (developer)
2013-10-18 03:56

I think the current default is fine, the problem is with whatever broke notifications.
User avatar (0038300)
atrol (developer)
2013-10-18 04:05

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.
User avatar (0038301)
dregad (developer)
2013-10-18 04:14

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.
User avatar (0038304)
dregad (developer)
2013-10-18 05:03

Infinite loop @ https://github.com/mantisbt/mantisbt/blob/master/core/email_api.php#L287 [^]
User avatar (0038305)
dregad (developer)
2013-10-18 06:01

I found 2 occurences of a while loop using db_result to retrieve data instead of db_fetch_array.
User avatar (0038705)
govind (reporter)
2013-12-01 22:04

sdfgdf
User avatar (0038736)
govind (reporter)
2013-12-01 22:05

xdfjghjgh

- Related Changesets
MantisBT: master dc3266a4
Timestamp: 2013-10-18 06:04:18
Author: 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.x => 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.x
2013-10-18 17:22 atrol Target Version 1.3.0dev => 1.3.x
2013-12-01 22:04 govind Note Added: 0038705
2013-12-01 22:05 govind Note Added: 0038736


MantisBT 1.2.17 [^]
Copyright © 2000 - 2014 MantisBT Team
Time: 0.1152 seconds.
memory usage: 3,093 KB
Powered by Mantis Bugtracker