Browse Source

[2947] Continue configuring other data sources even if there is a DataSourceLibraryError

Mukund Sivaraman 12 years ago
parent
commit
f57669ee93
2 changed files with 19 additions and 6 deletions
  1. 14 6
      src/lib/datasrc/client_list.cc
  2. 5 0
      src/lib/datasrc/datasrc_messages.mes

+ 14 - 6
src/lib/datasrc/client_list.cc

@@ -110,12 +110,20 @@ ConfigurableClientList::configure(const ConstElementPtr& config,
                           << datasrc_name);
                           << datasrc_name);
             }
             }
 
 
-            // Create a client for the underling data source via factory.
-            // If it's our internal type of data source, this is essentially
-            // no-op.  In the latter case, it's of no use unless cache is
-            // allowed; we simply skip building it in that case.
-            const DataSourcePair dsrc_pair = getDataSourceClient(type,
-                                                                 param_conf);
+            DataSourcePair dsrc_pair;
+            try {
+                // Create a client for the underling data source via
+                // factory.  If it's our internal type of data source,
+                // this is essentially no-op.  In the latter case, it's
+                // of no use unless cache is allowed; we simply skip
+                // building it in that case.
+                dsrc_pair = getDataSourceClient(type, param_conf);
+            } catch (const DataSourceLibraryError& ex) {
+                LOG_WARN(logger, DATASRC_LIBRARY_FAILURE).
+                    arg(datasrc_name).arg(rrclass_).arg(ex.what());
+                continue;
+            }
+
             if (!allow_cache && !dsrc_pair.first) {
             if (!allow_cache && !dsrc_pair.first) {
                 LOG_WARN(logger, DATASRC_LIST_NOT_CACHED).
                 LOG_WARN(logger, DATASRC_LIST_NOT_CACHED).
                     arg(datasrc_name).arg(rrclass_);
                     arg(datasrc_name).arg(rrclass_);

+ 5 - 0
src/lib/datasrc/datasrc_messages.mes

@@ -370,6 +370,11 @@ Therefore, the entire data source will not be available for this process. If
 this is a problem, you should configure the zones of that data source to some
 this is a problem, you should configure the zones of that data source to some
 database backend (sqlite3, for example) and use it from there.
 database backend (sqlite3, for example) and use it from there.
 
 
+% DATASRC_LIBRARY_FAILURE failure loading %1 datasource library for class %2: %3
+There was a problem loading the dynamic library for a data source. This
+backend is hence not available, and any data sources that use this
+backend will not be available.
+
 % DATASRC_LOAD_ZONE_ERROR Error loading zone %1/%2 on data source '%3': %4
 % DATASRC_LOAD_ZONE_ERROR Error loading zone %1/%2 on data source '%3': %4
 During data source configuration, an error was found in the zone data
 During data source configuration, an error was found in the zone data
 when it was being loaded in to memory on the shown data source.  This
 when it was being loaded in to memory on the shown data source.  This