Skip to content

Stop reading dataset records when JSON printer is in error state#819

Open
struga0258 wants to merge 3 commits intov3.x/stagingfrom
users/jsturga/jsonbugfix
Open

Stop reading dataset records when JSON printer is in error state#819
struga0258 wants to merge 3 commits intov3.x/stagingfrom
users/jsturga/jsonbugfix

Conversation

@struga0258
Copy link
Copy Markdown
Contributor

@struga0258 struga0258 commented Apr 8, 2026

Proposed changes:

When ZSS streams dataset contents via streamDataset(), the while (!feof(in)) loop continues reading every record of the dataset even if the JSON printer has already entered an error state (e.g., due to an EBCDIC conversion failure). For large datasets with unmappable characters, this causes ZSS to burn CPU reading and attempting to convert thousands of records that will all fail, producing repeated JSON: conversion error, rc 16, reason 4 messages and high CPU utilization.

This PR adds a check for jsonCheckIOErrorFlag(jPrinter) to the loop condition, so that streamDataset() stops reading records as soon as the JSON printer reports an IO error. This works in conjunction with zowe-common-c #590, which ensures the error flag is properly set when conversion fails.

Depends on: zowe/zowe-common-c#590

Type of change: Bug fix

Signed-off-by: James Struga <jstruga@rocketsoftware.com>
Signed-off-by: 1000TurquoisePogs <sgrady@rocketsoftware.com>
@sonarqubecloud
Copy link
Copy Markdown

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

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants