TProof::Detach vs TProofMgr::DetachSession

Hi,
I noticed the following behaviour, while trying to create a work around for the missing PROOF_ENVVAR feature for older ROOT versions.

I tried to start a PROOF session and disconnect from this session without terminating the PROOF server processes. From quickly looking at the source-code of TProofMgr::DetachSession, I would expect, that TProof::Detach and TProofMgr::DetachSession behave roughly the same.

However this does not be the case:

  TProof::AddEnvVar("FOO","bar");
  p1 = TProof::Open( proofmaster ); 
  p1->Exec("gSystem->Getenv(\"FOO\")");

  p1->GetManager()->DetachSession(p1);

// Quit ROOT, start ROOT again
  p2 = TProof::Open( proofmaster ); 
  p2->Exec("gSystem->Getenv(\"FOO\")");

does not terminate the server processes.

  TProof::AddEnvVar("FOO","bar");
  p1 = TProof::Open( proofmaster ); 
  p1->Exec("gSystem->Getenv(\"FOO\")");

  p1->Detach();

// Quit ROOT, start ROOT again
  p2 = TProof::Open( proofmaster ); 
  p2->Exec("gSystem->Getenv(\"FOO\")");

terminates the PROOF servers.

Unfortunately both functions doesn’t seem to be documented very well. Is the behaviour of both Detach functions intentionally different? If not, which is the intended behaviour?

Cheers,
Jörgen.

Hi,

By default when an idle client disconnects (e.g. detaches) the session is terminated. This should hold for both cases, either Detach or DetachSession.
The different behaviour is only due to the fact that DetachSession requires some additional information from the server (the actual implementation is in TXProofMgr) and there fore one more cleaning cycle. If you wait a bit (1 min or so) before running ‘p2 = TProof::Open( proofmaster )’ you should get a fully new session also in case 1.

If you need to make sure that the idle session stays alive across reconnection you have to change the default behaviour on the server side with the ‘xpd.shutdown’ directive (root.cern.ch/drupal/content/conf … e#shutdown); either

xpd.shutdown 1 60

or

xpd.shutdown 0

Gerri