Skip to content

Skip GOPACS redispatch announcements whose problem period has ended - #155

Open
Miggets7 wants to merge 1 commit into
mainfrom
fix/gopacs-expired-announcements
Open

Miggets7 wants to merge 1 commit into
mainfrom
fix/gopacs-expired-announcements

Conversation

@Miggets7

@Miggets7 Miggets7 commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

The GOPACS redispatch poller logged Failed to fetch EAN effectivity for announcement ...: HTTP 400 on production. GOPACS keeps listing announcements as ANNOUNCEMENT_OPEN after their problem period ends, but the effectivity endpoint rejects them with MSG_PROBLEM_NOT_OPEN. At the time of testing, 20 of the 40 open announcements were past their problem period, so every poll made 20 failing calls.

The handler now drops announcements whose problem period has ended before it checks effectivity. Non-200 warnings for the announcement and effectivity fetches now include the response body, so GOPACS error codes show up in the log.

Tested against the live GOPACS API. Effectivity returns 200 while the problem period is running, including after the bid window has closed, and 400 MSG_PROBLEM_NOT_OPEN once the problem period has ended. :ems:test passes, including the new GOPACSRedispatchHandlerTest.

GOPACS keeps listing announcements as ANNOUNCEMENT_OPEN after their
problem period has ended, but the EAN effectivity endpoint rejects them
with HTTP 400 MSG_PROBLEM_NOT_OPEN. On production this produced a
failed effectivity call and a warning for every such announcement on
every poll. Filter them out before checking effectivity.

Also log the response body when the announcement or effectivity fetch
fails, so the GOPACS error code shows up in the warning.
@Miggets7 Miggets7 added the Bug Error or issue in the system label Dec 2, 2026
@Miggets7
Miggets7 requested review from denniskuijs and wborn December 2, 2026 11:04

@wborn wborn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an initial AI-assisted review.

The expiry filter skips effectivity lookups once the problem period ends and keeps ongoing announcements eligible after the bid window closes. The regression test covers the exact expiry boundary. Two non-blocking follow-ups remain for error logging and the integration guide. CI passed formatting, build, and tests.

"Failed to fetch announcements: HTTP "
+ response.getStatus()
+ ": "
+ response.readEntity(String.class));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could both GOPACS warnings follow DistroGopacsHandler and always log the HTTP status, with a short error body when available? If readEntity(String.class) throws, the current code skips the warning and loses the status. This was reproduced with RESTEasy 7.0.5.Final using a 503 response with no entity stream. Changed code · Distro logging pattern

announcements.stream()
.filter(a -> ANNOUNCEMENT_TYPE_CONGESTIONMANAGEMENT.equals(a.getType()))
.filter(a -> ANNOUNCEMENT_STATE_OPEN.equals(a.getAnnouncementState()))
.filter(a -> !hasProblemPeriodEnded(a, now))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the integration guide’s selection and polling rules to say that expired problem periods are skipped even when GOPACS still lists the announcements as open. If every announcement in the response has expired, the poll clears the active announcement and resets the bid status to NONE. Changed code · Integration guide

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

Labels

Bug Error or issue in the system

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants