Skip to content

STC procedure drops HASPCKPT/HASPACE1, breaking mvsMF's jobs API #256

Description

@mgrossmann

What is wrong

c35ab59 removed the HASPCKPT and HASPACE1 DDs from samplib/httpd,
reasoning that the only consumer was HTTPJES2 and that "nothing else in the
server opens them". That check was run against httpd/src/ alone. It missed the
consumers that run inside HTTPD's address space.

mvsMF is a CGI module, so it is dispatched by the MVS LINK SVC into the HTTPD
STC's task. libc370's jesopen() (src/jes/jesopen.c:36,46) opens the JES2
checkpoint and spool by ddname:

cp = checkpoint_open("DD:HASPCKPT");
js = spool_open("DD:HASPACE1");

Those are task-level allocations. They have to be in the STC procedure, and
after c35ab59 the shipped procedure no longer has them.

mvsMF calls jesopen() from three places in jobsapi.c:

line function endpoint
157 jobListHandler GET /zosmf/restjobs/jobs
741 do_print_sysout spool file retrieval
1229 find_job_by_name_and_id single-job lookup

Symptom

Per request: HTTP 500 (REASON_INCORRECT_JES_VSAM_HANDLE) plus two console
lines — libc370's Unable to open checkpoint dataset DD:HASPCKPT and mvsMF's
MSG_JES_UNAVAILABLE. An operator-visible WTO flood, not a silent failure.

Job submit is unaffected: jesiropn() dynallocs its own INTRDR.

Three separate defects

  1. samplib/httpd — a fresh 4.0.0 install has no working jobs API.
  2. docs/migration.md:98 — the more severe half. It instructs 3.3.x
    migrators to delete the two DDs, which breaks a system that works today.
  3. docs/installation.md — describes /zosmf/* as "where the datasets,
    jobs and files live" and never states the requirement. mvsMF's own install
    docs do not state it either (tracked separately in mvslovers/mvsmf).

The same wrong reasoning is recorded in the root and project CLAUDE.md.

Scope of the fix

The sample library is not an SMP element — the generated inst.jcl says so
itself: "SMP handles the load modules only. The sample library is a plain PDS
restored by TSO RECEIVE." So no PTF and no new FMID: 4.0.1 rebuilds the samplib
XMIT and reships the archive.

Restore the two lines verbatim as they stood in 3.3.x. Not as symbolic
parameters: that adds an installation parameter that can be got wrong, and
changes the PROC interface in a patch release. The hardcoded VOL=SER is a real
portability problem, but the fix for it is libc370 dynallocating the checkpoint
and spool the way jesiropn() already dynallocs the INTRDR — a library change,
filed separately.

Audit of the neighbouring removals

The failure class is "the "nothing uses this" check was scoped to httpd's own
repo". Re-run against every consumer:

  • grep -rn "stck2tv|httpds_|HTTPJES2|HTTPDSL" over mvsmf/src, httplua/src,
    httprexx/srcno hits. Those removals were sound.
  • httplua dynallocs its own DDs; httprexx needs none.
  • The remaining DDs in the procedure are complete. SYSPRINT/SYSTERM/SYSIN
    are absent deliberately — httpstrt.c:47-68 refuses to start if they are
    allocated.

Tasks

  • samplib/httpd: restore both DDs, comment says why (mvsMF) and that
    VOL=SER must match the site's JES2 procedure
  • docs/migration.md: reverse the instruction
  • docs/installation.md: state the requirement where /zosmf/* is described
  • CLAUDE.md (root + project): correct the recorded reasoning
  • preserve the v4.0.0 release notes in-repo before the release is replaced
  • ship 4.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions