CommunicatorClass::slaveRefresh should verify if Zone is still configured in backend #596

Closed
Habbie opened this Issue Apr 26, 2013 · 5 comments

Projects

None yet

1 participant

@Habbie
Member
Habbie commented Apr 26, 2013

/var/log/messages:Oct 8 11:05:27 ns1 pdns[5740]: Initiating transfer of 'foo.bar' from remote '1.2.3.4'

/var/log/messages:Oct 8 11:05:27 ns1 pdns[5740]: Can't determine backend for domain 'foo.bar'

We suspect a race condition where CommunicatorClass::slaveRefresh
does not check if the (database)backend if the domain is still there or
has already been deleted.
The return value of B->getDomainInfo(di.zone, di); has to be verified.

@Habbie Habbie was assigned Apr 26, 2013
@Habbie Habbie closed this Apr 26, 2013
@Habbie Habbie added a commit that referenced this issue Apr 26, 2013
@Habbie Habbie avoid race condition, also avoid a rare crash. Patch from ticket #596
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@2802 d19b8d6e-7fed-0310-83ef-9ca221ded41b
f9fa0e2
@Habbie
Member
Habbie commented Apr 26, 2013

Attachment 'Fix' (slavecommunicator.patch) https://gist.github.com/5466801

@Habbie
Member
Habbie commented Apr 26, 2013

Author: peter
This patch looks like it just shortens the race a bit, at the cost of additional database queries for every transfer. I'm not sure this makes economic sense. Please comment :)

@Habbie
Member
Habbie commented Apr 26, 2013

Author: anon
Replying to [comment:1 peter]:

This patch looks like it just shortens the race a bit, at the cost of additional database
queries for every transfer. I'm not sure this makes economic sense. Please comment :)

B->getDomainInfo(di.zone, di) gets called in both versions anyway, the only thing we do is verifying it's return code. In the race we even reduce the overhead when getDomainInfo returns false.

@Habbie
Member
Habbie commented Apr 26, 2013

Author: peter
you're right, I misread that. Looks good!

@Habbie
Member
Habbie commented Apr 26, 2013

Author: peter
applied in r2802, thanks!

@mind04 mind04 pushed a commit to mind04/pdns that referenced this issue Apr 26, 2013
peter avoid race condition, also avoid a rare crash. Patch from ticket #596
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@2802 d19b8d6e-7fed-0310-83ef-9ca221ded41b
2a52895
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment