Skip to content

Increase UDF server startup timeout #1168

@yhlam

Description

@yhlam

There is a hard coded 1 minute timeout of starting python server process:

// now repeatedly try to create the Python interface object, waiting up to 1 minute to do it
for(int k=0; k<600; k++)
{
// try to create the object
hr = CoCreateInstance(clsid, NULL, CLSCTX_LOCAL_SERVER, IID_IDispatch, (void**) &(this->pInterface));
if(hr != REGDB_E_CLASSNOTREG)
break;
// didn't create object - check that python process is still there!
DWORD dwExitCode;
if(0 == GetExitCodeProcess(pi.hProcess, &dwExitCode))
throw formatted_exception() << "GetExitCodeProcess failed: " << GetLastErrorMessage();
if(dwExitCode != STILL_ACTIVE)
{
formatted_exception e;
e << "Python process exited before it was possible to create the interface object.";
if(this->HasValue("RedirectOutput"))
e << " Try consulting '" << this->GetValue("RedirectOutput") << "'.";
e << "\n";
e << "Command: " << cmdLine << "\nWorking Dir: " << workingDir;
throw e;
}
Sleep(100);
}

I have a python installation on a network drive. Sometimes, it can take more than 1 minute to start the python process due to network slowness. It would be nice if the timeout can be configured like other parameters, so that the timeout can be increased for use case like mine which expects long start up time.

Thanks.

p.s. This is a great project. Thank you so much for all your hard work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions