I've done a number of .NET geoprocessing tools for ArcGIS 10.1 that get published as geoprocessing services on ArcGIS Server.

Lately we've seen behavior that makes me question something I thought I long understood - the role of a tool's "FunctionFactory" (IGPFunctionFactory).

I thought:

  • the role of the factory was to create and hand out the Functions (IGPFunction) or their Names (IName/IGPName/GPFunctionNameClass) (in GetFunction(), GetFunctionName(), GetFunctionNames())
  • that one instance of the Factory gets created per process (ArcMap- desktop), (SOC - server), automatically by ArcGIS at process start, by virtue of the Factory being registered in its component category
  • so that you could rely on it to be in place before any instance of a tool/service could be used.

And so one thing I use the Factory for is one-time initialization (in a static ctor of the Factory) of services that are shared in common by all the tools exposed by the factory, such as configuration and logging.

Lately, promoting to a new environment, in a 2-machine cluster, we've seen cases (rare - one in a few dozen requests) where requests to a service are handled, but factory-based initialization has not yet occurred - so though the service is running, it is not yet configured (and so the request fails to be handled successfully), and neither is the log, so the error doesn't get logged (except by ArcGIS Server's own logging).

Any thoughts on what I'm missing?

  • To quote Emily Litella, "never mind". We had a configuration error on one of the two servers in the cluster, which prevented all the shared resources, including logging! from getting spun up. So I don't think I actually misunderstood anything, merely (re)learned a lesson ;-) – MC5 Apr 9 '15 at 15:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.