Fix pool contains wrong environment metadata (#221)
The generic pool manager creates a generic pool with the reference of environment metadata. Since the reference is address of loop variable, so the content of metadata will be replaced with the last element of envs. So pool manager sets up logging with wrong env.
This commit is contained in:
committed by
Soam Vasani
parent
62aa9d6d73
commit
c43cde8891
+2
-2
@@ -157,8 +157,8 @@ func (gpm *GenericPoolManager) eagerPoolCreator() {
|
||||
// creating pools for envs that are actually used by functions. Also we might want
|
||||
// to keep these eagerly created pools smaller than the ones created when there are
|
||||
// actual function calls.
|
||||
for _, env := range envs {
|
||||
_, err := gpm.GetPool(&env)
|
||||
for i := range envs {
|
||||
_, err := gpm.GetPool(&envs[i])
|
||||
if err != nil {
|
||||
log.Printf("eager-create pool failed: %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user