Permalink for updated KB article: www.outsystems.com/goto/timeouts-guide
Hi
Due to the web nature of the OutSystems platform, running over web application servers and databases, is implicit the existence of time limits to several interconnections.
Let's face it, how many of you never hit a timeout while developing, deploying or running an OutSystems application? In that regard, I think is time to talk about the several timeout events that can influence the proper development, deploying and runtime of OutSystems applications.
So, without further delay, let's meet the candidates. For the runtime level timeouts we have the SQL Query timeout, the application request timeout, the web service request timeout, the web server connection timeout, the session timeout and timer's timeout. While for deployment level timeouts we have the Service Studio Upload/Download timeout besides any runtime level timeouts that may also influence the deployment process.
Please note that usually, if you're having timeout events then either you have a very sluggish system, which can benefit from an upgrade or extended resources, or you have a very unoptimized logic, data models or slow integrations. Of course that depends on the application's purpose and dataset volumes, and the timeout settings should be adjusted accordingly.
SQL Query Timeout
Timeout Description
Being supported by a database backbone (either Microsoft SQL or Oracle) in nature, this is the most common timeout event that can occur in the OutSystems platform and their applications, specially low performance database servers or large data volume environments.
This SQL Query timeout defines the maximum amount of time that an SQL statement can take to be fully executed, and the resulting dataset be returned to the calling application. It influences OutSystems applications simple and advanced queries, as well as the entity actions
(Create, Update, Get, GetForUpdate and Deleted). It also influences the OutSystems platform system queries, scattered along the Service Center application and OutSystems Services. At the application level, it's possible to define this timeout value in Service Studio while in development
stage of an OML for simple or advanced queries., however, the entity actions and the OutSystems platform system queries do not have a timeout value definition that can be changed individually and follow a platform-wide default query timeout.
Timeout Symptoms
The symptoms detected when this timeout value is reached are usually a runtime error either in the applications or during deployment procedures, and a logged entry in Service Center. The log entry, for the most part looks very much like:
Message :Error in advanced query GetConsumers in Espace (SELECT ... ): Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.Stack: at ssServiceCenter.Actions.QueryEspace_UpdateCacheGetConsumers(HeContext heContext, Int32 maxRecords, String qpkey)at ssServiceCenter.Actions.UserActionEspace_UpdateCache(HeContext heContext, Int32 inParameSpaceId, Boolean inParamSkipConsumers, Boolean inParamOnlyConsumers)at ssServiceCenter.Actions.UserActionEspace_PrepareDeploy(HeContext heContext, Int32 inParamUserId, Int32 inParameSpaceId, Int32 inParamVersionId, Boolean inParamDebug, Boolean inParamExcludePTA, Boolean inParamExcludeCacheUpdate, RLReferenceRecordList inParamDeployPack, RLHEMessageRecordList& outParamErrors)at ssServiceCenter.Actions.UserActionEspace_Publish(HeContext heContext, Int32 inParamUserId, Int32 inParamVersionId, Boolean inParamForceDebug, Boolean inParamExcludePTA, Boolean inParamExcludeCacheUpdate, RLReferenceRecordList inParamPublishPack, RLHEMessageRecordList& outParamMessages, Int32& outParamErrorCount)at ssServiceCenter.Actions.WebSrvcServiceStudioPublish(HeContext heContext, String inParamusername, String inParampassword, Int32 inParamversionid, RLHEMessageRecordList& outParammessages)at ssServiceCenter.WebServices.ServiceStudio.Publish(String username, String password, Int32 versionid, WORCHEMessageRecord[]& messages)
In this case there's a explicit reference to a timeout and from the error stack we can assert that is occurring in a SQL query, in this example, the Advanced Query QueryEspace_UpdateCacheGetConsumers. However, this is not always the case. Sometimes the timeout error appears masked under a different error, usually a very nasty runtime error, like the one below:
Error in advanced query DeleteTestResults in DeleteInstanceFromDatabase ( DELETE ... ): Object reference not set to an instance of an object.at ssreg_dashboard.Flows.FlowAdministrationFlow.ScrnManageInstances.CommandDelete(HeContext heContext, Int32 inParamInstanceId)at ssreg_dashboard.Flows.FlowAdministrationFlow.ScrnManageInstances.wt_Submitwidget491643_Click(Object sender, EventArgs e)Exception has been thrown by the target of an invocation.at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess)at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean verifyAccess)at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)at ssreg_dashboard.Flows.FlowAdministrationFlow.ScrnManageInstances.recTableTableRecords1_Select(Object sender, DataGridCommandEventArgs e)at System.Web.UI.WebControls.DataGrid.OnItemCommand(DataGridCommandEventArgs e)at System.Web.UI.WebControls.DataGrid.OnBubbleEvent(Object source, EventArgs e)at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)at System.Web.UI.WebControls.DataGridItem.OnBubbleEvent(Object source, EventArgs e)at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)at System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e)at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)at System.Web.UI.Page.ProcessRequestMain()
In this case we appear to have a serious crash, which we immediately react with horror and fear when we find our selves in the presence of the infamous Object reference not set to an instance of an object error. But fear not, because this is in fact just a consequence of a timeout event that just exceeded the limit. Although this scenario is not as common as the previous one, it can occur when an SQL reader closes due to the timeout event, associated with some "bad" timing when it happens to be still under access, generating this null reference exception.
Timeout Setting
For the application simple and advanced queries, is possible to specify a timeout value in seconds, during eSpace editing (development phase). When these queries do not have a timeout value specified, they take into account the platform wide default query timeout instead. Additionally, any system query from Service Center or OutSystems Services, also takes this default value as the timeout. This default query timeout can be specified on the OutSystems Hub Server Configuration Tool on the database tab, and by default is defined with 30 seconds. Note that changing this value will influence the timeout value for all non-application queries. To run the tool you can execute the ServerSetup.exe application located in the Hub Server installation directory (or Service Center for the 4.1 versions). Always remember to exit the tool with the Ok button to commit your changes
I'll be adding the remaining timeout events in this topic over the next few days, so keep "posted".
Cheers
Miguel João
I have the "Thread was being aborted" timeout error symptoms in my .Net server.
I have an Outsystems application running on a .Net server that timesout,
The application function is simply this: receives a very big file (zip), unzips that file, and then reads it for processing.
I already check all the files (machine config and web config) and increased the timeouts by 20 minutes (just to be sure)!! But the applications timesout if the processing lasts longer than 3:20 minutes. Also increased the Tag for the max file size in the machine configs without resolving the problem. Any other sugestions? Thank you help would be very appreciated :=). The server can't have these problems.
Hi everyone
I would like to drop another timeout example that we ran accross in Support recently: timeout sending emails.
Email sending timeout
Description
Email sending is done in two steps:
The email sending timeout I am referring to is the one that happens in step 1. Meaning: the rendering of the email takes too long.
Symptoms
When such a timeout occurs, you get an error similar to: