Hi,
Whenever I create a new event in my public calendar, my website becomes unreachable.
I followed the installation instructions and added an events block to the page.
As long as the calendar is empty, the block renders ok with the value "none" inside.
But when I try to refresh the page after a new event was added, it takes forever to load.
I noticed that a file was created in the cache dir. Maybe some problem while parsing the input?
Regards
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | ed082768bed699b7c001f3d6ffc4fa2b.spc_.txt | 355.57 KB | kboden |
Comments
Comment #1
Se7enLC commentedFirst thing to check is whether the issue is the calendar. Try adding a block with a Calendar ID of "usa__en@holiday.calendar.google.com" and see if that is slow to load as well.
Try enabling "debug" mode under the admin page and let me know what that produces. There will be a lot of text all over the page, but some of it should be helpful.
Are there any errors listed under "Recent Log Entries" in the admin panel?
If it's appropriate, what is the calendar ID you are trying to display?
You could also try disabling cache by leaving the cache line blank. That's unlikely to make it load faster, but you never know.
Give those suggestions a try and let me know how it goes.
Comment #2
Se7enLC commentedI found a potential bug that was setting the cache time to 0 in all cases. This could make for a slow page, but not more than a 5-10 second load time in my testing.
I checked the changes into CVS, it should be included in the nightly build tonight, or if you want it sooner, grab version 1.6 of gcal_events.module and test it out.
I also cleaned up the debug_mode output and added some timing tests in there so you can see how long it takes to initialize the XML parser.
Comment #3
kboden commentedThanks for the suggestions.
Unfortunately, I'm experiencing the same problem with the feed from "usa__en@holiday.calendar.google.com".
The page keeps loading, 10, 20 minutes... and nothing happens. So I can't even get to the debug messages.
Nothing is logged in the recent log entries either.
In attachment you'll find the cache file.
I played around a little with your module code, commenting out the loops through the feed items, and it seems that the problem starts as soon as it's trying to access the feed items ($feed->get_items; or even $feed->get_item_quantity()).
So I guess it"s probably a simplepie bug.
Comment #4
Se7enLC commentedWhat versions do you have for simplepie.inc, gcal_event.module, and php? As a comparison, I'm running simplepie version 1.1.1, gcal_events.module version 1.7 and php version 5.2.6
Your diagnosis sounds reasonable - if it gets up and past feed-init() but can't seem to run get_items() or even get_item_quantity(), that is most likely a simplepie problem. You can try erasing the cache and forcing it to re-download, perhaps? Or delete the cache directory and disable the cache entirely?
Also, if you have more than one block enabled, try reducing it down to just one block and set that block to be the holiday calendar.
In the gcal_events_contents() function, you can return text at any point and have it display in the block. That might help in your debugging. Right before it calls feed_item_quantity() for example, you could have it return and display the amount of time it took to get to that point (a call to microtime(true) and subtract $start_time). SimplePie may have some status checking functions available that are worth looking at. I'm not positive on that, though. If you comment out the feed functions or return from the function early, the debug messages should show up.
Somethng else you might try: replace the call to $feed->get_items() with $feed->get_items(0,5). That should only get the first 5 items and should (hypothetically) take much less time to complete. Then again, the test holiday feed doesn't have very many items in it at all, so the entire thing should only take a few seconds anyway.
Sorry I'm not more helpful, I can't reproduce the error or even imagine what it could be. Keep posting your progress, though, or let me know if there's any other information that might help.
- Jeff
Comment #5
kboden commentedI'm running simplepie 1.1.1, gcal-events.module 1.6 and php 5.1.2.
I ran some additional tests, based on your suggestions. I noticed that initializing and parsing the feed runs very quickly, with or without the cache (ex. Feed Init took 0.0850229263306 seconds). So I think it's clear now that it's not a performance issue.
It really looks like it's going into an infinite loop somewhere.
So I installed the simplepie demo on my web server and tested the same USA holiday feed with the demo page... no problem.
The entire feed gets processed and displayed on the page right away.
So I don't get it, the same simplepie.inc lib works with the demo page, and stops working when it gets called from within the module.
I also added a few debug messages in the simplepie lib and it looks as if this line of code is causing the problem:
$this->data['items'][] =& new $this->item_class($this, $items[$key]);
(line 2922)
I will try to figure out the problem later this week and I'll keep you updated.
Thanks for the help
Kristof
Comment #6
Se7enLC commentedThanks for investingating this. I'm at a loss to explain it as well.
Something else worth trying: Modify the module code so that it can be run from a commandline. Just have it hard-code the calendar ID and spit the results out to the screen. If that works fine, see if it still works when called from the webserver (but not with drupal). Perhaps there is some kind of conflict with another drupal module?
Comment #7
kboden commentedWell, I found that there's a conflict with the Acquia Marina template that I'm using.
If I change it to the default Garland template for instance, the module works fine.
I raised an issue on the theme's project page.
Maybe they can point me into the right direction.
http://drupal.org/node/327672
Comment #8
Se7enLC commentedI just installed the acquia_marina theme to see if I could reproduce it. Calendar seems to work fine with the default settings for that theme. I tried to change some settings, but none of them seemed to have much of an effect, the calendar just displays fine in all cases.
Comment #9
Se7enLC commentedComment #10
jdwfly commentedToo old to be useful...