Service Module Host
ServiceModuleHost.exe is a Windows service that allows Saved Events to execute and is responsible for hosting plugin modules to simplify deployment and maintenance of processes that run in the background. Installation Manager sets the services to be started automatically; however, when you are building workflows, it is important to ensure that the Service Module Host is running on the server.
To stop or start the Service Module Host service:
-
On the server where the workflows are executed, select Start > Administrative Tools > Server Manager, right-click and select Run as administrator.
-
Navigate to Configuration > Services and select the Service Module Host service.
By default, the Startup Type of the Service Module Host is set to Automatic with a Status of Started.
-
To stop or restart the service, click Stop or Restart the service.
Service Module Host Config File
Installation Manager updates the configuration files to ensure that they point to the correct database and contain proper settings. The configuration file for the ServiceModuleHost.exe and normally does not need to be modified; however, you should be aware of the SQL Reconnect Setting and Connection Strings.
The Service Module Host config file is located in C:\Program Files (x86)\CMC\C2000\Services\Nexus Event Notification Service <version>
.
SQL Reconnect Setting
The Service Module Host service has logic to limit the reconnection attempts when the Service Module Host service senses a connection failure to the SQL database. The time duration is a configured value in seconds that the Service Module Host service uses to attempt the connection again. The settings contain a Number of Retries value indicating how many times to retry the connection.
If, after the number of attempts have been tried and the SQL server is still unavailable, the Service Module Host logs a fatal exception indicating that the Windows service should be restarted after the SQL connection issue has been resolved. The Service Module Host then needs to be stopped and restarted to re-establish the connection (see To stop or start the Service Module Host service:).
The following is an example of an error displayed in the workflow Event Log when the timeout expired and a reconnection was attempted:
2015-08-29 00:00:04.7756 13 Error
Cmc.Nexus.Utility.ServiceBroker.ServiceModule.ServiceBrokerServiceModule System.InvalidOperationException: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.
at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)
at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
at System.Data.SqlClient.SqlConnection.Open()
If errors like this occur frequently and fill up the event logs, you might need to adjust the values for ReconnectOnErrorNumberOfAttempts (default value = 5) and ReconnectOnErrorWaitSeconds (default value = 10) in the CONFIG file of the Service Module Host.
Connection Strings
The CONFIG file of the Service Module Host contains connection strings for the following databases:
- Anthology Student Database
- Database containing the workflow persistence tables
- Workflow Tracking Database