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

Close the connection when decoding exception happens #3290

Merged
merged 1 commit into from
Jun 12, 2024
Merged

Conversation

violetagg
Copy link
Member

Fixes #3285

@violetagg violetagg added the type/bug A general bug label Jun 10, 2024
@violetagg violetagg added this to the 1.0.46 milestone Jun 10, 2024
@violetagg violetagg requested a review from a team June 10, 2024 16:08
@pderop
Copy link
Member

pderop commented Jun 10, 2024

it seems some other tests are not passing anymore, like HttpServerTest.keepAlive()

@violetagg
Copy link
Member Author

it seems some other tests are not passing anymore, like HttpServerTest.keepAlive()

yeah the change should be in the if (decoderResult.isFailure()) {

@pderop
Copy link
Member

pderop commented Jun 10, 2024

I see that the ctx is closed on decoding failure, but only if the logger is enabled in DEBUG mode ?

I mean, instead of

				if (log.isDebugEnabled()) {
					if (msg instanceof DecoderResultProvider) {
						DecoderResult decoderResult = ((DecoderResultProvider) msg).decoderResult();
						if (decoderResult.isFailure()) {
							log.debug(format(ctx.channel(), "Decoding failed."), decoderResult.cause());
							//"FutureReturnValueIgnored" this is deliberate
							ctx.close();
							listener.onUncaughtException(connection, decoderResult.cause());
						}
					}

					log.debug(format(ctx.channel(), "No ChannelOperation attached."));
				}

shouldn't it be something like this ?

				if (msg instanceof DecoderResultProvider) {
					DecoderResult decoderResult = ((DecoderResultProvider) msg).decoderResult();
					if (decoderResult.isFailure()) {
						if (log.isDebugEnabled()) {
							log.debug(format(ctx.channel(), "Decoding failed."), decoderResult.cause());
						}
						//"FutureReturnValueIgnored" this is deliberate
						ctx.close();
						listener.onUncaughtException(connection, decoderResult.cause());
					}

					if (log.isDebugEnabled()) {
						log.debug(format(ctx.channel(), "No ChannelOperation attached."));
					}
				}

@violetagg
Copy link
Member Author

@pderop Thanks, check the new commit

Copy link
Member

@pderop pderop left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@violetagg
Copy link
Member Author

@pderop I found one additional issue, commit is commit in the next minutes.

@violetagg
Copy link
Member Author

I will move the fix for the next release. I want to play more with various scenarios.

@violetagg violetagg modified the milestones: 1.0.46, 1.0.47 Jun 10, 2024
@pderop
Copy link
Member

pderop commented Jun 10, 2024

ok Violeta.

@violetagg
Copy link
Member Author

@pderop The PR is ready for review

@violetagg
Copy link
Member Author

@pderop Thanks!

@violetagg violetagg merged commit c3031d5 into 1.0.x Jun 12, 2024
9 checks passed
@violetagg violetagg deleted the issue-3285 branch June 12, 2024 12:40
violetagg added a commit that referenced this pull request Jun 12, 2024
violetagg added a commit that referenced this pull request Jun 12, 2024
violetagg added a commit that referenced this pull request Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug A general bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Internal state of HttpObjectDecoder is not reset when connection pooling is used
2 participants