Skip to content

Instantly share code, notes, and snippets.

@Habbie
Created April 26, 2013 11:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Habbie/5466740 to your computer and use it in GitHub Desktop.
Save Habbie/5466740 to your computer and use it in GitHub Desktop.
supermaster anti-race workaround
Index: packethandler.cc
===================================================================
--- packethandler.cc (revision 2575)
+++ packethandler.cc (working copy)
@@ -778,7 +778,13 @@
L<<Logger::Error<<"Unable to find backend willing to host "<<p->qdomain<<" for potential supermaster "<<p->getRemote()<<endl;
return RCode::Refused;
}
- db->createSlaveDomain(p->getRemote(),p->qdomain,account);
+ try {
+ db->createSlaveDomain(p->getRemote(),p->qdomain,account);
+ }
+ catch(AhuException& ae) {
+ L<<Logger::Error<<"Database error trying to create "<<p->qdomain<<" for potential supermaster "<<p->getRemote()<<": "<<ae.reason<<endl;
+ return RCode::ServFail;
+ }
Communicator.addSuckRequest(p->qdomain, p->getRemote());
L<<Logger::Warning<<"Created new slave zone '"<<p->qdomain<<"' from supermaster "<<p->getRemote()<<", queued axfr"<<endl;
return RCode::NoError;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment