Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call LineRecorder receiver's closeStream() (#433) #434

Closed
wants to merge 1 commit into from

Conversation

dr0i
Copy link
Member

@dr0i dr0i commented Dec 27, 2021

Under some circumstances (probably if the JVM is not stopped after processing)
the streams of receivers connected to LineRecorder are not closed, resulting
in empty or missing output data.

  • complement test

See #433.

Under some circumstances (probably if the JVM is not stopped after processing)
the streams of receivers connected to LineRecorder are not closed, resulting
in empty or missing output data.

- complement test
@dr0i dr0i self-assigned this Dec 27, 2021
@dr0i dr0i linked an issue Dec 27, 2021 that may be closed by this pull request
@dr0i dr0i requested review from blackwinter and fsteeg December 27, 2021 17:28
@@ -81,7 +81,9 @@ public void resetStream() {

@Override
public void closeStream() {
assert !isClosed();
Copy link
Member

Choose a reason for hiding this comment

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

This is rather unusual. AFAICS, no other module does this (inside closeStream() that is).

Copy link
Member Author

Choose a reason for hiding this comment

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

Do you really mean assert !isClosed(); ? There are alternatives like if (!isClosed) {. Does it make any difference, semantically? Would it be better to use the if statement?

Copy link
Member

Choose a reason for hiding this comment

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

The assert means you can't (shouldn't) close a closed stream, while the conditional simply ignores an already closed stream. I think the latter behaviour would be preferable in general.

@dr0i
Copy link
Member Author

dr0i commented Dec 30, 2021

Closing this in favour of #435.

@dr0i dr0i closed this Dec 30, 2021
@dr0i dr0i deleted the 433-closeiStreamOfLineRecordersReceiver branch January 11, 2022 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Close LineRecorder receiver's stream when closing LineRecorder
2 participants