Skip to content

bug: 10 second URL test comes with 1 second api_ctx nil value error #3193

@azura27

Description

@azura27

Issue description

When I test with WRK, 10 seconds flow would have one second error, and cause the QPS to decrease 1w
For issue tracing:
in function: common_phase(phase_name) ADD log: core.log.error("nil instance: api_ctx") after the "api_ctx = ngx.ctx.api_ctx"
in function: http_log_phase() ADD log: core.log.error("fail to create healthcheck instance: ", err) after "api_ctx = common_phase("log")"

Environment

Minimal test code / Steps to reproduce the issue

  1. run apisix with plugins open: zipkin, limit-count, prometheus,consumer-restriction,key-auth
  2. run test with wrk ./wrk -t 4 -d 10 -c 3000

What's the actual result? (including assertion message & call stack if applicable)

2021/01/05 13:51:25 [error] 5324#5324: *97919 [lua] init.lua:653: common_phase(): nil instance: api_ctx while logging request, client:
2021/01/05 13:51:25 [error] 5324#5324: *97919 [lua] init.lua:753: http_log_phase(): fail to create healthcheck instance: nil while logging request, client:

What's the expected result?

no error log and higher QPS

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions