Kong / kong

🦍 The Cloud-Native API Gateway and AI Gateway.
https://konghq.com/install/#kong-community
Apache License 2.0
38.35k stars 4.75k forks source link

Kong plugins doesn't get executed unless kong reloaded or restarted #4191

Closed rucciva closed 5 years ago

rucciva commented 5 years ago

Please read the CONTRIBUTING.md guidelines to learn on which channels you can seek for help and ask general questions:

https://github.com/Kong/kong/blob/master/CONTRIBUTING.md#where-to-seek-for-help

Summary

After creating around 72 services, 72 route, 3*72 route's plugins, 72 consumer, 72 routes + consumers plugins, when sending the request to any route, the plugins won't get executed. Only after kong reload or restart does the plugins get executed

Steps To Reproduce

  1. git clone https://github.com/rucciva/kong-plugin-bug
  2. cd kong-plugin-bug && docker-compose up -d && docker-compose logs -f set-up
  3. wait until set-up service done. all 72 routes are available via /api-[1-72]/v1.0.0 path
  4. invoke any route, e.g. curl localhost:8000/api-3/v1.0.0. No plugins get executed
  5. wait for minutes
  6. re-invoking the route still produce the same result
  7. reload or restart via docker-compose exec kong kong reload or docker-compose exec kong kong restart
  8. re-invoking the api, now the plugins get executed

Additional Details & Logs

rucciva commented 5 years ago

Shed some light. the behaviour is only found when creating plugins with PUT method. even at 1 route 1 service 3 plugins, the plugins will not get executed. But after creating the plugins with POST method, the plugins get executed normally. i notice that the PUT method in 1.0.0 is slightly different than in 0.14.x.

Steps To Reproduce

  1. git clone https://github.com/rucciva/kong-plugin-bug
  2. cd kong-plugin-bug && git checkout create-plugin-with-post && docker-compose up -d && docker-compose logs -f set-up
  3. wait until set-up service done. all 72 routes are available via /api-[1-72]/v1.0.0 path
  4. invoke any route, e.g. curl localhost:8000/api-3/v1.0.0. the plugins is executed
hishamhm commented 5 years ago

@rucciva Thank you for the investigation! I sent a PR to fix this.

thibaultcha commented 5 years ago

We just release 1.0.2, which should address this issue. Thanks for the report @rucciva!