Edgewall Software

Ticket #1729 (closed defect: fixed)

Opened 3 years ago

Last modified 23 months ago

RSS reader causes Trac to crash

Reported by: PBruin Owned by: cmlenz
Priority: highest Milestone: 0.9
Component: general Version: devel
Severity: critical Keywords:
Cc: peter.bruin@…

Description

My Trac web site crashes 9 out of 10 times when starting my RSS Reader

  • Using RSS Owl as rss reader
  • Apache 2.0.52 mod_python 3.1.4 python 2.3.5 on Windows XP
  • Other websites on the same server will still work as per normal
  • Using Trac [1864]
  • When restarting Apache Windows XP comes with a crash message in libhttpd.dll or ntdll.dll
  • Apache log file does not contain much usefull info
    • [notice] Child 6708: Terminating 5 threads that failed to exit.

Is anybody else experiencing the same problem?

Attachments

Change History

Changed 3 years ago by PBruin

  • priority changed from high to highest
  • severity changed from critical to blocker

Some more info. I am actually getting three RSS streams:
https://trac.myserver.com/trac/timeline?changeset=on&ticket=on&milestone=on&max=50&daysback=90&format=rss
https://trac.myserver.com/trac/timeline?changeset=on&ticket=on&ticket_details=on&milestone=on&wiki=on&max=100&daysback=7&format=rss
https://trac.myserver.com/trac/report/9?format=rss&USER=PBruin
It will cause trac to stop responding, the only way to continue is to restart Apache. Is there maybe some additional info that you would like me to provide?

Changed 3 years ago by cboos

You should also enable logging for Trac (see TracLogging) and look there for a stack trace.

Your problem is likely related to multithreaded issues... (see #1721)

In the meantime, you can setup a tracd server (with rev >= r1875, which has the multithreading disabled) and see if this still happens, with your RSS reader starting 3 simultaneous requests.

Changed 3 years ago by PBruin

I used this configuration for logging

[logging]
log_file = trac.log
log_level = DEBUG
log_type = file

All I got was this debug info.

10:16:41 Trac[formatter] DEBUG: Executing Wiki macro TOC by provider <trac.wiki.macros.UserMacroProvider object at 0x04A0B3F0>
10:16:48 Trac[svn_fs] DEBUG: Opening subversion file-system at /repos/sw with scope /
10:16:48 Trac[cache] DEBUG: Checking whether sync with repository is needed
10:16:48 Trac[svn_fs] DEBUG: Closing subversion file-system at /repos/sw
10:16:52 Trac[svn_fs] DEBUG: Opening subversion file-system at /repos/sw with scope /
10:16:52 Trac[cache] DEBUG: Checking whether sync with repository is needed
10:16:52 Trac[svn_fs] DEBUG: Closing subversion file-system at /repos/sw
10:17:00 Trac[svn_fs] DEBUG: Opening subversion file-system at /repos/sw with scope /
10:17:00 Trac[cache] DEBUG: Checking whether sync with repository is needed
10:17:00 Trac[svn_fs] DEBUG: Opening subversion file-system at /repos/sw with scope /

What I did:

  • 10:16:41 Restart Apache
  • 10:16:48 Reload rss feed 1
  • 10:16:52 Reload rss feed 2
  • 10:17:00 Reload both feeds at the same time

Changed 3 years ago by cboos

This problem is related to #1401 for the cause (crash in SVN bindings) and to #1811 for the context (Apache server (2.0.54, worker)).

From your log:

...
10:17:00 Trac[svn_fs] DEBUG: Opening subversion file-system at /repos/sw with scope /
10:17:00 Trac[cache] DEBUG: Checking whether sync with repository is needed
10:17:00 Trac[svn_fs] DEBUG: Opening subversion file-system at /repos/sw with scope /

it seems that two subversion filesystem objects are opened at the same time, therefore by two different threads.

While theoretically this shouldn't be a problem since each call to the SVN API should be done with the GIL held, I suspect that this is not implemented in a very robust way in the bindings...

In the meantime, you should try to setup a server which doesn't make use of threads. As I don't use apache myself, I'm not sure the prefork model is available on Windows, but if so, you could try to use this model instead of mpm_winnt one, as it is probably the case.

Changed 3 years ago by PBruin

Thanks for the tip. I have not used the prefork module as I cann't find much on it for Windows but after your tip have reduced the number of Threads per child from 250 to 1. This prevents the crashes and I will stick with this for the moment.

<IfModule mpm_winnt.c>
ThreadsPerChild 1
MaxRequestsPerChild  0
</IfModule>

Changed 3 years ago by cboos

Can you please try out the patch cmlenz wrote for #1811? (with ThreadsPerChild set higher than 1, of course)

Changed 3 years ago by PBruin

  • severity changed from blocker to normal

Bingo,

Tried the patch with the ThreadsPerChild? set back to 250 and it seems to work fine. I can hit the reload favarites button many times without a problem.

Thanks

Changed 3 years ago by cmlenz

  • owner changed from jonas to cmlenz
  • status changed from new to assigned
  • severity changed from normal to critical

Thanks for testing the patch.

Changed 3 years ago by cmlenz

  • status changed from assigned to closed
  • resolution set to fixed

This has hopefully been fixed in [2013]. Please reopen if you still encounter an error related to this.

Add/Change #1729 (RSS reader causes Trac to crash)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.