Edgewall Software

Ticket #5632 (closed defect: fixed)

Opened 16 months ago

Last modified 11 months ago

Non-egg plugins show up multiple times in a multi-project setup

Reported by: Dave Abrahams <dave@…> Owned by: osimons
Priority: normal Milestone: 0.10.5
Component: general Version: devel
Severity: critical Keywords: plugin
Cc:

Description

For simple, single-python-file plugins, my admin panel shows N checkboxes where N is the number of trac instances in my multi-project environment.

Attachments

plugins.png (134.0 kB) - added by Dave Abrahams <dave@…> 16 months ago.
Screeshot of Admin panel

Change History

  Changed 16 months ago by Dave Abrahams <dave@…>

  • severity changed from normal to critical

I take it back; N is seemingly random. And this is not a benign presentation bug; the plugins will take effect N times. That can result in N transformations of the same wiki text, for example, where only one was intended.

follow-up: ↓ 3   Changed 16 months ago by cboos

  • milestone changed from 0.11 to 0.10.5

N corresponds to the number of environments that have been activated so far and that contain a version of the plugin.

It's a serious issue but I don't think it's 0.11 specific. Can someone checks if this happens on 0.10-stable as well?

in reply to: ↑ 2   Changed 16 months ago by Dave Abrahams <dave@…>

Replying to cboos:

N corresponds to the number of environments that have been activated so far and that contain a version of the plugin.

I'm pretty sure it's not that, unless I don't understand what you mean by "activated so far." My setup has 9 trac environments. The attached screenshot is just the first of 5 similar pages!

Changed 16 months ago by Dave Abrahams <dave@…>

Screeshot of Admin panel

  Changed 16 months ago by Dave Abrahams <dave@…>

FWIW I am using [inherit] to share a single plugins directory.

  Changed 16 months ago by cboos

  • keywords plugin added

Well, when I start a server with two environments, each containing a few single file plugins in <env>/plugins, then everything is fine for the first environment I visit (/admin/plugins lists the expected plugins). Then, I go to the second environment and there I see the expected plugins, plus the ones already loaded by the first environment. Going back to the first env now will also show all mixed plugins.

This is with 0.10.5dev. I somehow have the impression this is old news, but I can't find a pre-existing ticket.

In your case, there could be additional issues...

  Changed 12 months ago by osimons <simon-code@…>

I think the problem could be fixed by the changes in the plugin loader made at [6016:6017].

Could you please verify?

  Changed 11 months ago by osimons

  • owner changed from jonas to osimons

In case we want this for 0.10 (which is probably a good idea), I've tested this patch on that branch as well (as of r 6233):

  • 0.10-stable/trac/loader.py

     
    4949                if plugin_name not in loaded_components: 
    5050                    env.log.debug('Loading file plugin %s from %s' % \ 
    5151                                  (plugin_name, plugin_file)) 
    52                     module = imp.load_source(plugin_name, plugin_file) 
     52                    if plugin_name not in sys.modules: 
     53                        module = imp.load_source(plugin_name, plugin_file) 
    5354                    loaded_components.append(plugin_name) 
    5455                    if auto_enable and plugin_name + '.*' \ 
    5556                            not in env.config['components']: 

Think it should be correct - works fine for me, but more testing is welcome.

follow-up: ↓ 9   Changed 11 months ago by cboos

+1 for backporting this

in reply to: ↑ 8   Changed 11 months ago by osimons

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

Replying to cboos:

+1 for backporting this

Ported in [6256]. Closes ticket.

Add/Change #5632 (Non-egg plugins show up multiple times in a multi-project setup)

Author



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