You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What happened:
metadata run plugin metadata() order vary.
For me I have two plugins have the func Metadata(ctx context.Context, state request.Request)
it should be calling in func (m *Metadata) ServeDNS...
in a fixed order.
But when I start server, it may runs inverse order as before.
What you expected to happen:
Run in a fixed order.
How to reproduce it (as minimally and precisely as possible):
If you setup 2 plugin has metadata, you can check
func setup(c *caddy.Controller) error {
m, err := metadataParse(c)
if err != nil {
return err
}
dnsserver.GetConfig(c).AddPlugin(func(next plugin.Handler) plugin.Handler {
m.Next = next
return m
})
c.OnStartup(func() error {
plugins := dnsserver.GetConfig(c).Handlers()
for _, p := range plugins {
if met, ok := p.(Provider); ok {
m.Providers = append(m.Providers, met)
}
}
return nil
})
return nil
}
If you set a breakpoint to
plugins := dnsserver.GetConfig(c).Handlers()
you should see sometimes plugins items order changes.
This will cause order of items in m.Providers changes.
I added two images run runs without change corefile. You can see the redis and sortByLoc orders changes in the plugins.
What happened:
metadata run plugin metadata() order vary.
For me I have two plugins have the func
Metadata(ctx context.Context, state request.Request)
it should be calling in
func (m *Metadata) ServeDNS...
in a fixed order.
But when I start server, it may runs inverse order as before.
What you expected to happen:
Run in a fixed order.
How to reproduce it (as minimally and precisely as possible):
If you setup 2 plugin has metadata, you can check
If you set a breakpoint to
you should see sometimes plugins items order changes.
This will cause order of items in m.Providers changes.
I added two images run runs without change corefile. You can see the redis and sortByLoc orders changes in the plugins.
Anything else we need to know?:
Environment:
Distributor ID: Ubuntu
Description: Ubuntu 20.04.6 LTS
Release: 20.04
Codename: focal
the version of CoreDNS: 1.9.3
Corefile:
logs, if applicable:
OS (e.g:
cat /etc/os-release
):Others:
The text was updated successfully, but these errors were encountered: