Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Publishing ends up publishing many Components and runs out of memory

Tags:

tridion

We have noticed that component publishing takes a long time.

The component we are trying to publish has pdf's and jpg's in it. It also has links to other components.

Looking at the logs we found that publisher is trying to publish multimedia items from the component and also MM components from the linked components. The linked components have more linked components.

Some components publish after a long time and some fail throwing memory exception.

Is this a bug in Tridion? Has anyone ran into this issue before?

like image 882
user1373140 Avatar asked Feb 21 '23 04:02

user1373140


2 Answers

This is by design, if you want to prevent SDL Tridion resolving these additional items, you will need to modify the instructions that are sent to the Publisher. If you are using SDL Tridion 2009 or earlier, you will need to do this using an event system. If you are on version 2011 or greater, you can take advantage of the new Custom Resolvers. Perhaps you can specify which version you are using.

If you are on 2011, take a look at this article on Custom Resolvers: http://www.tridiondeveloper.com/a-custom-resolver-in-practice

If you are on 2009, you may find this Event sample handy

public void OnComponentPublishPre(Component Component, IXMLDOMDocument2 publishInstruction)
{
    //Code to prevent publishing linked components

    XmlNode nodePropagateLinks = (XmlNode)publishInstruction.selectSingleNode("ResolveComponentLinks");
    if (nodePropagateLinks == null)
    {
        IXMLDOMNode nodeResolveLinks = publishInstruction.createNode(XmlNodeType.Element, "ResolveComponentLinks", "http://www.tridion.com/ContentManager/5.0");
        nodeResolveLinks.text = "false";
        publishInstruction.documentElement.appendChild(nodeResolveLinks);

    }
}
like image 194
Chris Summers Avatar answered Apr 27 '23 14:04

Chris Summers


It is indeed quite common that publishing a "well connected" Component can trigger an avalanche of items to be included in that publish action. Tridion in this case often takes an all or nothing approach when determining which linked items to include.

If you want more control over what gets published, you should consider writing a custom resolver as described here: http://www.tridiondeveloper.com/a-custom-resolver-in-practice

like image 27
Frank van Puffelen Avatar answered Apr 27 '23 12:04

Frank van Puffelen