Skip to content

[BUG] SQL running on V1 engine failed, throw exception "Request id not present in current context" #537

Closed

Description

@penghuo

Describe the bug

To Reproduce

  1. Enable V1 engine.
curl -H 'Content-Type: application/json' -X PUT localhost:9200/_opendistro/_sql/settings -d '{
  "persistent" : {"opendistro.sql.engine.new.enabled" : "false"}
}'
  1. Set slowlog to 0s.
curl -XPUT "http://localhost:9200/_cluster/settings" -H 'Content-Type: application/json' -d'{ 
  "persistent" : {"opendistro.sql.query.slowlog" : 0}
}'
  1. Post query, get exception.
java.lang.IllegalStateException: Request id not present in current context

Root Cause
SQL plugin use log4j ThreadContext to maintain request_id, but OpenSearch security plugin's SecurityFilter clear ThreadContext. Which cause getRequestsId call throw exception.

Activity

  1. added
    bug
    on Apr 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Priority-Highbugv2.0.0

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions