Skip to content

Pilot manager handler simplifications - #8624

Merged
fstagni merged 5 commits into
DIRACGrid:integrationfrom
fstagni:pilotManagerHadler_simplifications
Jul 8, 2026
Merged

Pilot manager handler simplifications#8624
fstagni merged 5 commits into
DIRACGrid:integrationfrom
fstagni:pilotManagerHadler_simplifications

Conversation

@fstagni

@fstagni fstagni commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

First part for #8597

BEGINRELEASENOTES

*WMS
CHANGE: Removed several RPCs and DB calls for PilotManager

ENDRELEASENOTES

@fstagni
fstagni force-pushed the pilotManagerHadler_simplifications branch 2 times, most recently from d51a5b2 to e5aa050 Compare June 17, 2026 09:12
@aldbr

aldbr commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

ddev: just need to make sure that htcondor does not remove the outputs from the spool once you requested it once.

@fstagni
fstagni force-pushed the pilotManagerHadler_simplifications branch from e5aa050 to 1e804d8 Compare June 18, 2026 12:46
@iueda

iueda commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Checking the BelleDIRAC code following the question at the last Dops+Ddev meeting, we don't have any extension of PilotManagerHandler nor PilotAgentsDB, but I see some RPC calls with RPCClient('WorkloadManagement/PilotManager') such as getGroupedPilotSummary()

@fstagni

fstagni commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

Checking the BelleDIRAC code following the question at the last Dops+Ddev meeting, we don't have any extension of PilotManagerHandler nor PilotAgentsDB, but I see some RPC calls with RPCClient('WorkloadManagement/PilotManager') such as getGroupedPilotSummary()

That has been moved to DB-only call, no need to go through the RPC.

@fstagni
fstagni force-pushed the pilotManagerHadler_simplifications branch 3 times, most recently from 7a863b7 to a3c9ac4 Compare June 23, 2026 08:10
@aldbr aldbr linked an issue Jun 26, 2026 that may be closed by this pull request
@fstagni

fstagni commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

Some info related to the removal of PilotOutput table and related methods:

Historically, running condor_transfer_data did not affect the job's presence in the queue, so it was possible to invoke it multiple times on the same job and retrieve the same output files each time.
However, this behavior changed recently in the HTCondor 25.x series. A successful condor_transfer_data now causes the job to become eligible to leave the queue shortly afterwards. This change was introduced because many users expected the job to be automatically cleaned up after retrieving the output, rather than having to run condor_rm separately.
So the answer depends on the HTCondor version in use: older versions allow repeated retrievals, while newer versions may remove the job from the queue after a successful transfer, preventing subsequent condor_transfer_data invocations.
Jamie (James Frey) also mentioned that the HTCondor team would be open to adding an option to preserve the old behavior if there is interest in such a use case.

This puts for the moment a halt on the attempt to simply remove the DIRAC functionality.

@fstagni
fstagni force-pushed the pilotManagerHadler_simplifications branch 2 times, most recently from 67ca2ee to efb2294 Compare July 6, 2026 15:10
@fstagni
fstagni marked this pull request as ready for review July 6, 2026 15:11
@fstagni
fstagni requested a review from atsareg as a code owner July 6, 2026 15:11
@fstagni

fstagni commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

Some info related to the removal of PilotOutput table and related methods:

Historically, running condor_transfer_data did not affect the job's presence in the queue, so it was possible to invoke it multiple times on the same job and retrieve the same output files each time.
However, this behavior changed recently in the HTCondor 25.x series. A successful condor_transfer_data now causes the job to become eligible to leave the queue shortly afterwards. This change was introduced because many users expected the job to be automatically cleaned up after retrieving the output, rather than having to run condor_rm separately.
So the answer depends on the HTCondor version in use: older versions allow repeated retrievals, while newer versions may remove the job from the queue after a successful transfer, preventing subsequent condor_transfer_data invocations.
Jamie (James Frey) also mentioned that the HTCondor team would be open to adding an option to preserve the old behavior if there is interest in such a use case.

This puts for the moment a halt on the attempt to simply remove the DIRAC functionality.

Functionality restored.

@fstagni fstagni changed the title Pilot manager hadler simplifications Pilot manager handler simplifications Jul 6, 2026
@fstagni
fstagni force-pushed the pilotManagerHadler_simplifications branch from efb2294 to 6747469 Compare July 7, 2026 09:25
@fstagni
fstagni merged commit b2d665e into DIRACGrid:integration Jul 8, 2026
23 checks passed
@DIRACGridBot DIRACGridBot added the sweep:ignore Prevent sweeping from being ran for this PR label Jul 8, 2026
@iueda

iueda commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

That has been moved to DB-only call, no need to go through the RPC.

Would it work not only in the system-side use cases, but also in client use cases?

I was expecting a Belle II colleague to ask this question with more details, but I don't see any yet, so I put my comment here after ~3 weeks.

@aldbr

aldbr commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Would it work not only in the system-side use cases, but also in client use cases?

Were you using getGroupedPilotSummary from a client? Can you provide further details about your use case and you usage please? Right now I think it's not possible anymore, but we can potentially move that to the WebAppHandler if necessary.

@michmx

michmx commented Jul 24, 2026

Copy link
Copy Markdown

Hi @aldbr. Sorry for jumping in late in the discussion. Yes, we provide a diagnostic tool to users to collect information about the operation status, particularly relevant when they have been waiting for jobs to be pulled by a pilot for a long time.

The tool retrieves the Sites by the optimizer from the JDL (determined at optimization), and uses information from the pilot summary to check if pilots have been running in the site(s) at all, like:

        dirac_rpc = RPCClient('WorkloadManagement/PilotManager')
        fromm = datetime.utcnow() - timedelta(days=1)
        to = datetime.utcnow()
        conddict = {'Site': sites, 'FromDate': fromm , 'ToDate': to}
        result = dirac_rpc.getGroupedPilotSummary(conddict,['GridSite'])

This is executed on the client. With the change in this PR, we need to reconsider how to retrieve pilot statistics from the client. If available in the WebAppHandler, we could use it in principle (I think, unless I am missing a detail about authorization).

@fstagni

fstagni commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

Hi @michmx , I added getGroupedPilotSummary in #8730 in the WebAppHandler. For you, this means moving to:

        dirac_rpc = RPCClient('Monitoring/WebApp')
        fromm = datetime.utcnow() - timedelta(days=1)
        to = datetime.utcnow()
        conddict = {'Site': sites, 'FromDate': fromm , 'ToDate': to}
        result = dirac_rpc.getGroupedPilotSummary(conddict,['GridSite'])   

Let me know if this is OK for you.

Cheers,
Federico

@michmx

michmx commented Jul 31, 2026

Copy link
Copy Markdown

Yes, this is a simple change on our side. Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sweep:ignore Prevent sweeping from being ran for this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create a legacy adaptor for PilotManager PilotManager refactor

5 participants