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

[improve] [broker] Print warn log if ssl handshake error & print ledger id when switch ledger #21201

Merged
merged 2 commits into from
Sep 28, 2023

Conversation

poorbarcode
Copy link
Contributor

@poorbarcode poorbarcode commented Sep 18, 2023

Motivation

1693900615781 WARN org.apache.pulsar.client.impl.ClientCnx Error during handshake java.nio.channels.ClosedChannelException: null
  at org.apache.pulsar.shade.io.netty.handler.ssl.SslHandler.channelInactive(SslHandler.java:1065)
  at org.apache.pulsar.shade.io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:305)
  at org.apache.pulsar.shade.io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:281
  at org.apache.pulsar.shade.io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:274) 
  at org.apache.pulsar.shade.io.netty.channel.DefaultChannelPipeline$HeadContext.channelInactive(DefaultChannelPipeline.java:1405)
  at org.apache.pulsar.shade.io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:301)
  at org.apache.pulsar.shade.io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:281)
  at org.apache.pulsar.shade.io.netty.channel.DefaultChannelPipeline.fireChannelInactive(DefaultChannelPipeline.java:901)
  at org.apache.pulsar.shade.io.netty.channel.AbstractChannel$AbstractUnsafe$7.run(AbstractChannel.java:813)
  at org.apache.pulsar.shade.io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174)
  at org.apache.pulsar.shade.io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167)
  at org.apache.pulsar.shade.io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
  at org.apache.pulsar.shade.io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:403)
  at org.apache.pulsar.shade.io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
  at org.apache.pulsar.shade.io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
  at org.apache.pulsar.shade.io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
  at java.lang.Thread.run(Thread.java:955)

After SSL handshake fails, it will trigger a user event and close the socket. see https://github.com/netty/netty/blob/4.1/handler/src/main/java/io/netty/handler/ssl/SslUtils.java#L438-L446

    static void handleHandshakeFailure(ChannelHandlerContext ctx, Throwable cause, boolean notify) {
        // We have may haven written some parts of data before an exception was thrown so ensure we always flush.
        // See https://github.com/netty/netty/issues/3900#issuecomment-172481830
        ctx.flush();
        if (notify) {
            ctx.fireUserEventTriggered(new SslHandshakeCompletionEvent(cause));
        }
        ctx.close();
    }

Pulsar ignored this event, so we don't know what happened.

Modifications

  • Print a warning log if the SSL handshake error
  • Print ledger ID when switching ledger

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository: x

@poorbarcode poorbarcode self-assigned this Sep 18, 2023
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Sep 18, 2023
@poorbarcode poorbarcode added release/3.0.2 release/2.11.3 release/2.10.6 and removed doc-not-needed Your PR changes do not impact docs labels Sep 18, 2023
@poorbarcode poorbarcode added this to the 3.2.0 milestone Sep 18, 2023
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Sep 18, 2023
@Technoboy- Technoboy- closed this Sep 18, 2023
@Technoboy- Technoboy- reopened this Sep 18, 2023
@poorbarcode poorbarcode merged commit 8485d68 into apache:master Sep 28, 2023
67 of 72 checks passed
poorbarcode added a commit that referenced this pull request Oct 7, 2023
…er id when switch ledger (#21201)

### Modifications
- Print a warning log if the SSL handshake error
- Print ledger ID when switching ledger

(cherry picked from commit 8485d68)
poorbarcode added a commit that referenced this pull request Oct 8, 2023
…er id when switch ledger (#21201)

### Modifications
- Print a warning log if the SSL handshake error
- Print ledger ID when switching ledger

(cherry picked from commit 8485d68)
poorbarcode added a commit that referenced this pull request Oct 8, 2023
…er id when switch ledger (#21201)

### Modifications
- Print a warning log if the SSL handshake error
- Print ledger ID when switching ledger

(cherry picked from commit 8485d68)
liangyuanpeng pushed a commit to liangyuanpeng/pulsar that referenced this pull request Oct 11, 2023
…er id when switch ledger (apache#21201)

### Modifications
- Print a warning log if the SSL handshake error 
- Print ledger ID when switching ledger
mukesh-ctds pushed a commit to datastax/pulsar that referenced this pull request Apr 15, 2024
…er id when switch ledger (apache#21201)

### Modifications
- Print a warning log if the SSL handshake error
- Print ledger ID when switching ledger

(cherry picked from commit 8485d68)
(cherry picked from commit f243925)
mukesh-ctds pushed a commit to datastax/pulsar that referenced this pull request Apr 17, 2024
…er id when switch ledger (apache#21201)

### Modifications
- Print a warning log if the SSL handshake error
- Print ledger ID when switching ledger

(cherry picked from commit 8485d68)
(cherry picked from commit f243925)
mukesh-ctds pushed a commit to datastax/pulsar that referenced this pull request Apr 19, 2024
…er id when switch ledger (apache#21201)

### Modifications
- Print a warning log if the SSL handshake error
- Print ledger ID when switching ledger

(cherry picked from commit 8485d68)
(cherry picked from commit f243925)
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Apr 23, 2024
…er id when switch ledger (apache#21201)

### Modifications
- Print a warning log if the SSL handshake error
- Print ledger ID when switching ledger

(cherry picked from commit 8485d68)
(cherry picked from commit f243925)
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.

3 participants