motiv-labs / janus

An API Gateway written in Go
https://hellofresh.gitbooks.io/janus
MIT License
2.79k stars 317 forks source link

PT-1479 Fixed server initialisation race condition #339

Closed vgarvardt closed 6 years ago

vgarvardt commented 6 years ago

What does this PR do?

When loading proxy definitions from filesystem proxy register may be uninitialised in some cases because of race condition. I extracted proxy register initialisation outside of go-routine to avoid the possibbility of it.

Fixes https://github.com/hellofresh/janus/issues/338

codecov[bot] commented 6 years ago

Codecov Report

Merging #339 into master will not change coverage. The diff coverage is 25%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #339   +/-   ##
=======================================
  Coverage   41.41%   41.41%           
=======================================
  Files          74       74           
  Lines        2523     2523           
=======================================
  Hits         1045     1045           
  Misses       1415     1415           
  Partials       63       63
Impacted Files Coverage Δ
pkg/plugin/oauth2/loader.go 0% <0%> (ø) :arrow_up:
pkg/api/repository.go 0% <0%> (ø) :arrow_up:
pkg/plugin/oauth2/setup.go 7.86% <0%> (ø) :arrow_up:
pkg/plugin/oauth2/file_repository.go 54.54% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 113ee80...40759bf. Read the comment docs.

rafaeljesus commented 6 years ago

:shipit: