Timeout in K2SPSList - CreateWorkspace

Last post 08-26-2008, 10:46 by richardmarkiewicz. 4 replies.
Sort Posts: Previous Next
  •  08-18-2008, 10:01 25547

    Timeout in K2SPSList - CreateWorkspace

    Hi

     The workflow I'm looking at is unchanged since it entered production at the start of 2007. Since then we have had over 275 process instances run without any problems. The first event in the process uses the "Workspace" SharePoint template to create a new SharePoint site.

    Today it has thrown an error "System.Exception: System.Net.WebException: The operation has timed out". Ok, I thought, maybe something happened on the web server while we were creating the site. I verify that I can access the site collection etc, then press "Repair Error". Now I get a new exception in service manager: "The web address [address of new site] is already in use".

     So I go and check and indeed it is - the web service created the site just fine. I delete the site, repair error again and the server churns a way for a minute or two before rethrowing the original "operation has timed out". Except again, it has actually created the site just fine.

     This is the code - bog standard with the only modification (I think) being that we use a string variable for the template rather than set it directly with a literal value:

        // Call Web Service to create the Workspace
        if (! (SpsList.CreateWorkSpace(Site, WorkSpaceName.ToString(), WorkSpaceTitle.ToString(),
                            WorkSpaceDescription.ToString(), strTemplate, false, false, ref Result, ref ErrorMessage))) {
            // Error Occurred in CreateWorkSpace - Raise Error
            throw new System.Exception(ErrorMessage);
         } else {
            System.Xml.XmlDocument ResultXmlDoc = new System.Xml.XmlDocument();
            ResultXmlDoc.LoadXml(Result);
            WorkSpaceUrl = ResultXmlDoc.SelectSingleNode("Results/Url").InnerText;
        }

        K2.ProcessInstance.DataFields["Somedatafield"].Value = WorkSpaceUrl;
    }

     One interesting thing is that "Somedatafield" is not getting set; although like I say the site is created properly.

    The web service is not failing in other processes - I have tested and they are all working fine.

    I worked around if for this issue by simply modifying the code when repairing the error to prevent it from trying to create the site again, and simply assigning the datafield to the value of the URL.

    I would really like to know what's happening here. But how can I troubleshoot inside the web service? Particularly as it seems to be functioning correctly, it's just apparently not returning for some reason. This only started today, on this one workflow.

    Many thanks in advance,

    Richard

  •  08-21-2008, 12:43 25607 in reply to 25547

    Re: Timeout in K2SPSList - CreateWorkspace

    Hi,

    We've seen an error which is similar. We're also getting the Timeout error and it's not because Sharepoint is actually timing out. In our situation Sharepoint may take a long time to create the workspace if there is a conflict or major load on any of the tables it's writing the data to. This then slows down the creation of the workspace.... but it does eventually complete.

    This suggests to me that the K2SPSList.CreateWorkspace method has it's own timeout period independent of the actual Sharepoint process. What I don't know is whether that timeout period can be adjusted in the K2SPSList class/object.

    The other angle of attack is to work out why the Sharepoint process is taking longer than normal.

    Hope this helps a bit.

    DBK

    Filed under: , ,
  •  08-21-2008, 6:27 25613 in reply to 25607

    Re: Timeout in K2SPSList - CreateWorkspace

    Thanks for the reply DBK

    Your hypothesis sounds about right - K2 simply times out waiting for an answer from SharePoint. It's hard to know what's really happening without seeing the internals of "CreateWorkspace" though. I wonder if it's worth running the DLL through Reflector. Or maybe someone from K2 might jump in here and share some of the specifics.

     If I figure anything out on my own, I'll try to post it back here. Although the error hasn't reoccurred since so I'm not pressing *too* hard for a solution; it would be nice to know though.

     Thanks again,

    Richard

  •  08-26-2008, 9:27 25701 in reply to 25613

    Re: Timeout in K2SPSList - CreateWorkspace

    Hi Richard,

    We currently believe that the issue is due to the number of sub-sites we have for that site. We currently have more than 2000 sub-sites for the site against which the issues is occuring. There are known performance issues in Sharepoint 2003. See this article for more information:

    http://technet.microsoft.com/en-us/library/cc262787.aspx

    I will let you know if we have confirmation that it is the number of sub-sites causing the problem. 

    DBK

  •  08-26-2008, 10:46 25705 in reply to 25701

    Re: Timeout in K2SPSList - CreateWorkspace

    Thanks DBK

    In our case, the site collection in question has ~250 sub sites. That is more than most site collections in our environment but should be well within tolerances. I noticed that several instances of the workflow have started since we had a problem and they have all run fine.

    I would certainly be grateful if you could share your ultimate conclusion with me when you get confirmation.

    Many thanks,

    Richard

View as RSS news feed in XML