fix(bdev.batch): 배치 Job XML 생성 마법사가 decision 처리 중 무한 루프에 빠지는 문제 수정 - #141
Open
EricSeokgon wants to merge 1 commit into
Open
fix(bdev.batch): 배치 Job XML 생성 마법사가 decision 처리 중 무한 루프에 빠지는 문제 수정#141EricSeokgon wants to merge 1 commit into
EricSeokgon wants to merge 1 commit into
Conversation
appendDecisionElement()의 `j =+ decisionDone;`은 `j += decisionDone`이 아니라 `j = +decisionDone`으로 해석되어, 현재 Job에 속하지 않는 decision을 만나면 루프 인덱스가 고정되어 무한 루프에 빠진다. 해당 줄을 제거해 목록 전체를 jobName으로 필터링하도록 한다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
수정 사유 (Reason for modification)
문제 (재현)
CreateBatchJobXMLFileOperation.appendDecisionElement()의 반복문 첫 줄이 다음과 같습니다.=+는 복합대입 연산자가 아니라 대입 + 단항 플러스이므로, 매 반복마다j가decisionDone값으로 되돌아갑니다.decisionDone은 현재 Job 에 속한 decision 을 실제로 출력했을 때만 증가하므로, 목록에서 다른 Job 의 decision 을 만나면j가 그 자리에 고정되어 반복문이 끝나지 않습니다. 마법사 Finish 시 IDE 가 응답하지 않게 됩니다.재현 조건:
decisionVOList에 여러 Job 의 decision 이 함께 담기고, 현재 Job 의 decision 을 모두 처리한 뒤에도 뒤에 다른 Job 의 decision 이 2건 이상 남아 있는 경우(decisionDone + 1 < decisionVOList.size()).반대로 단일 Job 이 모든 decision 을 소유하는 경우에는
decisionDone이 인덱스와 함께 증가해 정상 종료되기 때문에, 이 결함이 지금까지 드러나지 않은 것으로 보입니다.수정 내용
j =+ decisionDone;한 줄을 제거했습니다. 반복문은 목록 전체를 순회하며jobName으로 필터링하는 형태가 되어, 같은 파일의 step 처리 반복문(stepVOList를jobName으로 필터링)과 동일한 방식이 됩니다.for (j = 0; j < decisionVOList.size(); j++) { - j =+ decisionDone; if(decisionVOList.size() > j){ if(jobName.equals(decisionVOList.get(j).getJobName())){검증 (실측)
해당 반복문의 제어 흐름을 그대로 옮긴 standalone 하네스로, 수정 전/후를 동일 입력으로 비교했습니다(무한 루프는 반복 상한으로 판정, JDOM 출력 대신
decider{index}:{name}기록).[decider0:decA, decider1:decB1, decider2:decB2][decider0:decB1, decider1:decB2][decider0:d1, decider1:d2, decider2:d3][decider0:d1, decider1:d2]현재 정상 동작하는 C·D 는 결과가 완전히 같고(
beanMap키로 쓰이는decider{인덱스}도 동일), A·B 의 무한 루프만 해소됩니다.참고
이 수정으로
decisionDone필드는 값이 증가하기만 하고 더 이상 읽히지 않는 상태가 됩니다. 필드와 증가문까지 함께 정리하는 편이 좋으시면 이 PR 에 반영하겠습니다.