[p4] p4com and long-running tasks

Andreas Axelsson Andreas.Axelsson at dice.se
Mon Oct 3 01:26:35 PDT 2005

Hi all,

has anyone been calling the p4com.dll from .NET and C# for any
long-running tasks? I've got a tool which monitors submissions to
trigger builds in a continuous integration system and it keeps failing
for some reason after having been active for several hours.

I first assumed it was failing because the perforce server was being
offline running backups at night, but that doesn't seem to be the case.
Running against non-existing servers, or a local service that's turned
off produces another error message. Checking the server logs indicates
that backup is running on-line and not on the times that the tool fails.

Some details:
The tool uses p4com to regularly query for changes on certain files.
Sometimes, usually during the night, it fails with:
The server threw an exception. (Exception from HRESULT: 0x80010105
(RPC_E_SERVERFAULT)) at P4COM.p4Class.run(String cmd)

The odd thing is that it never recovers after that error. No matter if
the server is available or not. It continues to report the same error
until the tool is restarted.

If I run against a local server, which is turned on and off, I get the
following error:
(0x80020009): Connect to server failed; check $P4PORT. TCP connect to
aax-1:1666 failed. connect: aax-1:1666: WSAECONNREFUSED
Turning the server on again restores the functionality.

Any clues? I'll be able to swap my use of p4com for a commandline
process launcher (like the one cc.net uses), but with the api at hand
it's annoying that I'd have to resort to that.

Btw, I tried creating new instances of the p4com::p4 class whenever a
failure showed up. So far it has resulted in a silent shutdown of the
tool. Further investigation pending...

Thanks for any insight
Andreas Axelsson
Programmer & Founder
Digital Illusions CE AB
axl at dice.se

More information about the perforce-user mailing list