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

block in sysread since ssl enabled #48

Open
walkerlin0 opened this issue May 17, 2022 · 2 comments
Open

block in sysread since ssl enabled #48

walkerlin0 opened this issue May 17, 2022 · 2 comments
Labels

Comments

@walkerlin0
Copy link

Logstash information:

  1. Logstash version (e.g. bin/logstash --version)
    Using bundled JDK: /home/linkaitao/download/logstash-8.1.3/jdk
    logstash 8.1.3

  2. Logstash installation source (e.g. built from source, with a package manager: DEB/RPM, expanded from tar or zip archive, docker)
    Download from https://github.com/elastic/logstash/archive/refs/tags/v8.1.3.tar.gz

  3. How is Logstash being run (e.g. as a service/service manager: systemd, upstart, etc. Via command line, docker/kubernetes)
    bin/logstash --path.settings config

  4. How was the Logstash Plugin installed
    Built in

JVM (e.g. java -version):

  1. JVM version (java -version)
    openjdk 11.0.11 2021-04-20
    OpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2.20.04)
    OpenJDK 64-Bit Server VM (build 11.0.11+9-Ubuntu-0ubuntu2.20.04, mixed mode, sharing)

OS version (uname -a if on a Unix-like system):
Linux LAPTOP-T38O03V7 4.4.0-19041-Microsoft #1237-Microsoft Sat Sep 11 14:32:00 PST 2021 x86_64 x86_64 x86_64 GNU/Linux

openssl version
OpenSSL 1.1.1f 31 Mar 2020

Description of the problem including expected versus actual behavior:
Problem:
Using SSL to send messages but blocked in reading response and the whole pipeline is stopped.

Expect:
Send messages continuously, don't get stuck.

config at client side:

input {
  http {
     host => "0.0.0.0"
     port => 6002
  }
}

output {
  tcp {
    codec => "line"
    host => "10.75.6.33"
    port => 8888
    ssl_enable => "true"
    ssl_cacert => "config/cert/ca.pem"
    ssl_verify => true
    mode => "client"
    reconnect_interval => 1
  }
}

config at server side:

input {
  tcp {
    codec => "line"
    host => "0.0.0.0"
    port => 8888
    ssl_enable => true
    ssl_cert => "config/cert/server.crt"
    ssl_key => "config/cert/server.key"
    ssl_key_passphrase => "***"
    ssl_verify => false
    tcp_keep_alive => true
  }
}

output {
  stdout {
    codec => rubydebug {
      metadata => true
    }
  }
}

Steps to reproduce:
Setup logstash like above, and execute cmd "curl http://127.0.0.1:6002 -d 'testing msg'" at client side. First time after the cmd been executed the message will be printed on server side. But after that, server side won't print any more messages no matter how many times i execute the cmd at client side.
The below log showing while i press CTRL+C at client side.

Provide logs (if relevant):
[2022-05-17T16:35:24,731][WARN ][org.logstash.execution.ShutdownWatcherExt] {"inflight_count"=>0, "stalling_threads_info"=>{"other"=>[{"thread_id"=>30, "name"=>"[main]>worker0", "current_call"=>"[...]/vendor/bundle/jruby/2.5.0/gems/logstash-output-tcp-6.0.2/lib/logstash/outputs/tcp.rb:161:in `block in sysread'"}]}}

@walkerlin0 walkerlin0 added the bug label May 17, 2022
@walkerlin0
Copy link
Author

walkerlin0 commented May 18, 2022

Under Linux, select() may report a socket file descriptor as "ready for reading", while nevertheless a subsequent read blocks.

from: https://stackoverflow.com/questions/5351994/will-read-ever-block-after-select

Is it reasonable to read the socket while the socket is readable ?

@brady-ss
Copy link

set this option input/output both

ssl_supported_protocols => ["TLSv1.2"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants