Skip to content

Support the HTCondor v2 python bindings#46

Open
ikrommyd wants to merge 1 commit into
CoffeaTeam:mainfrom
ikrommyd:htcondor2-compat
Open

Support the HTCondor v2 python bindings#46
ikrommyd wants to merge 1 commit into
CoffeaTeam:mainfrom
ikrommyd:htcondor2-compat

Conversation

@ikrommyd

@ikrommyd ikrommyd commented Jul 24, 2026

Copy link
Copy Markdown

🤖 AI text below 🤖

HTCondor 25 removed the v1 python bindings (HTCONDOR-3240), so import htcondor fails on current coffea images — e.g. coffeateam/coffea-0.7-almalinux9:0.7.31-py3.11, which ships htcondor 25.11.0. The distribution is still named htcondor, so pip show htcondor still finds it; only the module was renamed to htcondor2.

This ports the package rather than pinning, so it works on both. Alternative to #45.

Three v2 differences mattered:

  • import htcondor → prefer htcondor2, fall back to htcondor.
  • HTCondorIOError is gone, along with every other HTCondorException subclass. Aliased to the surviving base class.
  • Submit.jobs() raises NotImplementedError in v2, and Schedd.spool() now takes the SubmitResult instead of a list of job ads. Both are used together in LPCCondorJob.start, so they are wrapped in a spool() helper in schedd.py.

That third one is the reason this is more than an import fix — without it the package imports cleanly and then fails on every job submission.

Everything else works unchanged: param, Collector, Schedd.query/act, Submit, JobAction, and the AdTypes/DaemonTypes enums, which htcondor2 keeps as explicit back-compat aliases. xquery() isn't used anywhere, so there is no query-loop to rewrite. No setup.cfg change is needed since the distribution name is unchanged.

Verified

Against real conda-forge python-htcondor builds on py3.11:

version modules present selected checked
23.0.27 htcondor only v1 real HTCondorIOError subclass preserved; Submit.jobs() works; spool() gets a list — i.e. pre-PR behaviour
23.10.27 both v2 module selection
24.0.21 both v2 full suite passes
25.11.0 htcondor2 only v2 from lpcjobqueue import LPCCondorCluster OK; every touched attribute resolves; Submit.jobs() raises NotImplementedError; Schedd.spool is (result: SubmitResult); except HTCondorIOError catches HTCondorException

Two things worth knowing:

  • htcondor2 exists from 23.10 onward, so this moves 23.10/24 users onto the v2 bindings too, not just 25 users. That is deliberate — v1 is the Boost.Python build that won't get wheels for newer Pythons — but it is a behaviour change for people who are working fine today. Happy to invert the preference to v1-first if you'd rather only move users who have no choice.
  • Not covered: a live submit/spool round trip against a real schedd, and acquire_schedd() against a live collector. Those need an LPC node, so a smoke test before merging would be worthwhile — the spool change above is exactly the path I could not exercise end to end.

One note for maintainers

The HTCondorIOError alias widens the three except clauses in cluster.py to catch any HTCondorException. All three are schedd-communication retry paths so this is mostly benign, but non-IO HTCondor errors will now be retried rather than propagating. If you'd prefer it explicit, I can swap the alias for a SCHEDD_RETRY_ERRORS tuple in schedd.py and use that in the except clauses instead.

HTCondor 25 removed the version 1 bindings (HTCONDOR-3240), so `import
htcondor` now fails on current coffea images. Prefer htcondor2 and fall
back to htcondor, alias the removed HTCondorIOError to the surviving
HTCondorException, and route spooling through a helper since v2's
Schedd.spool() takes the SubmitResult and does not implement Submit.jobs().

Assisted-by: ClaudeCode:claude-opus-5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant