[Pkg-nagios-devel] Bug#311695: Rather difficult to reproduce
Don Armstrong
Don Armstrong <don@debian.org>, 311695@bugs.debian.org
Thu, 2 Jun 2005 23:52:11 -0700
--HlL+5n6rz5pIUxbD
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
After going back through this, I was able to reproduce the bug... and
the fix is really rather trivial.
Basically what happens is that the transaction errors out, and xrdbb.c
immediately retries the transaction, which is insane, frankly.
The following patch clears up the problem.
--- xdata/xrddb.c~ 2005-06-02 19:37:07.000000000 -0700
+++ xdata/xrddb.c 2005-06-02 23:47:01.000000000 -0700
@@ -641,7 +641,11 @@
snprintf(buffer,sizeof(buffer)-1,"Error: Could not insert retention data for host '%s' in table '%s'\n",host_name,XRDDB_HOSTRETENTION_TABLE);
buffer[sizeof(buffer)-1]='\x0';
write_to_logs_and_console(buffer,NSLOG_RUNTIME_ERROR,TRUE);
- continue;
+ /* Continuing will cause the transaction to
+ loop endlessly in the case of an unreachable
+ or improperly configured database, which is
+ insane. */
+ /* continue; */
}
temp_host=get_host_state_information(temp_host,&host_name,&state,&plugin_output,&last_check,&checks_enabled,&time_up,&time_down,&time_unreachable,&last_notification,¤t_notification_number,¬ifications_enabled,&event_handler_enabled,&problem_has_been_acknowledged,&flap_detection_enabled,&failure_prediction_enabled,&process_performance_data,&last_state_change);
Whether it's worth fixing this for sarge is up to the maintainer and
RM.
Don Armstrong
--
N: Why should I believe that?"
B: Because it's a fact."
N: Fact?"
B: F, A, C, T... fact"
N: So you're saying that I should believe it because it's true.
That's your argument?
B: It IS true.
-- "Ploy" http://www.mediacampaign.org/multimedia/Ploy.MPG
http://www.donarmstrong.com http://rzlab.ucr.edu
--HlL+5n6rz5pIUxbD
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="311695_patch.diff"
--- xdata/xrddb.c~ 2005-06-02 19:37:07.000000000 -0700
+++ xdata/xrddb.c 2005-06-02 23:47:01.000000000 -0700
@@ -641,7 +641,11 @@
snprintf(buffer,sizeof(buffer)-1,"Error: Could not insert retention data for host '%s' in table '%s'\n",host_name,XRDDB_HOSTRETENTION_TABLE);
buffer[sizeof(buffer)-1]='\x0';
write_to_logs_and_console(buffer,NSLOG_RUNTIME_ERROR,TRUE);
- continue;
+ /* Continuing will cause the transaction to
+ loop endlessly in the case of an unreachable
+ or improperly configured database, which is
+ insane. */
+ /* continue; */
}
temp_host=get_host_state_information(temp_host,&host_name,&state,&plugin_output,&last_check,&checks_enabled,&time_up,&time_down,&time_unreachable,&last_notification,¤t_notification_number,¬ifications_enabled,&event_handler_enabled,&problem_has_been_acknowledged,&flap_detection_enabled,&failure_prediction_enabled,&process_performance_data,&last_state_change);
--HlL+5n6rz5pIUxbD--