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

the server closed connection before returning the first response byte #12

Open
xiaobao623 opened this issue Jan 9, 2025 · 4 comments
Open

Comments

@xiaobao623
Copy link

测试环境
OCP-4.14
ES-7.14.1

loadgen 1.22、1.24、1.27

都有相同的问题,看起来是写入太快,或者header问题

错误信息如下

[01-09 10:13:06] [INF] [loader.go:240] [POST] http://192.168.35.161:31386/_bulk?routing=$[[id]], [] - {"index": {"_index": "medcl", "_type": "_doc", "_id": "ctvj1cgvbipmo305mdsg"}}
{"id": "250", "field1": "efg", "now_local": "2025-01-09 10:13:06.732339772 +0800 CST", "now_unix": "1736388786"}

[01-09 10:13:06] [INF] [loader.go:241] status: 0, error: the server closed connection before returning the first response byte. Make sure the server returns 'Connection: close' response header before closing the connection, response: 
@SteveLauC
Copy link
Member

SteveLauC commented Jan 9, 2025

可以提供复现的步骤吗?

  • 你使用的 yml/dsl 配置文件
  • 启动 loadgen 的 cli 参数

@xiaobao623
Copy link
Author

v1.4.0 运行正常。

@xiaobao623
Copy link
Author

运行CLI
./loadgen-linux-amd64 -c 5 -d 600

配置文件loadgen.yml

## How to use loadgen?
##  $ES_ENDPOINT=https://localhost:9200 ES_USERNAME=admin  ES_PASSWORD=b14612393da0d4e7a70b ./bin/loadgen -config loadgen.yml

env:
  ES_USERNAME: test
  ES_PASSWORD: test1234
  ES_ENDPOINT: http://192.168.35.161:31386

runner:
#  total_rounds: 1
  no_warm: true
  valid_status_codes_during_warmup: [ 200,201,404 ]
  # Whether to log all requests
  log_requests: false
  # Whether to log all requests with the specified response status
  log_status_codes:
    - 0
    - 500
  assert_invalid: false
  assert_error: false
  # Whether to reset the context, including variables, runtime KV pairs, etc.,
  # before this test run.
  reset_context: false
  default_endpoint: $[[env.ES_ENDPOINT]]
  default_basic_auth:
    username: $[[env.ES_USERNAME]]
    password: $[[env.ES_PASSWORD]]

variables:
#  - name: ip
#    type: file
#    path: dict/ip.txt
#    replace: # replace special characters in the value
#      '"': '\"'
#      '\': '\\'
  - name: id
    type: sequence
  - name: id64
    type: sequence64
  - name: uuid
    type: uuid
  - name: now_local
    type: now_local
  - name: now_utc
    type: now_utc
  - name: now_utc_lite
    type: now_utc_lite
  - name: now_unix
    type: now_unix
  - name: now_with_format
    type: now_with_format #https://programming.guide/go/format-parse-string-time-date-example.html
    format: "2006-01-02T15:04:05-0700" #2006-01-02T15:04:05
  - name: suffix
    type: range
    from: 10
    to: 1000
  - name: bool
    type: range
    from: 0
    to: 1
  - name: list
    type: list
    data:
      - "medcl"
      - "abc"
      - "efg"
      - "xyz"
  - name: id_list
    type: random_array
    variable_type: number # number/string
    variable_key: suffix # variable key to get array items
    square_bracket: false
    size: 10 # how many items for array
  - name: str_list
    type: random_array
    variable_type: string # number/string
    variable_key: suffix #variable key to get array items
    square_bracket: true
    size: 10 # how many items for array
    replace:
      '"': "'" # use ' instead of " for string quotes
      # use {} instead of [] as array brackets
      "[": "{"
      "]": "}"

requests:
  - request: #prepare some docs
      method: POST
      runtime_variables:
        batch_no: uuid
      runtime_body_line_variables:
        routing_no: uuid
      basic_auth: #override default auth
        username: test
        password: test1234
        url: http://192.168.35.161:31386/_bulk
      body: |
        {"index": {"_index": "medcl", "_type": "_doc", "_id": "$[[uuid]]"}}
        {"id": "$[[id]]", "field1": "$[[list]]", "now_local": "$[[now_local]]", "now_unix": "$[[now_unix]]"}
        {"index": {"_index": "infinilabs", "_type": "_doc", "_id": "$[[uuid]]"}}
        {"id": "$[[id]]", "field1": "$[[list]]", "now_local": "$[[now_local]]", "now_unix": "$[[now_unix]]"}
#  - request: #search this index
#      method: POST
#      runtime_variables:
#        batch_no: uuid
#      runtime_body_line_variables:
#        routing_no: uuid
#      basic_auth: #override default auth
#        username: $[[env.ES_USERNAME]]
#        password: $[[env.ES_PASSWORD]]
#      url: $[[env.ES_ENDPOINT]]/medcl/_search #override with full request url
#      body: |
#        { "track_total_hits": true, "size": 0, "query": { "terms": { "patent_id": [ $[[id_list]] ] } } }

  #add more requests

@xiaobao623
Copy link
Author

xiaobao623 commented Jan 9, 2025

另外,
loadgen.yml 示例文件里, search method还是POST,应该是GET吧?

#  - request: #search this index
#      method: POST  

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

No branches or pull requests

2 participants