mirror of
				https://github.com/Icinga/icinga2.git
				synced 2025-10-31 19:24:25 +01:00 
			
		
		
		
	Catch exceptions in the thread running HandleConfigUpdate
With dc3062a9b06fed69cdbb1508ace6eb2f77f87553, exceptions in this code path were no longer caught properly. This commit restores exception handling for this function.
This commit is contained in:
		
							parent
							
								
									dd8b786b3b
								
							
						
					
					
						commit
						c5ce54918e
					
				| @ -312,7 +312,16 @@ Value ApiListener::ConfigUpdateHandler(const MessageOrigin::Ptr& origin, const D | ||||
| 		return Empty; | ||||
| 	} | ||||
| 
 | ||||
| 	std::thread([origin, params, listener]() { listener->HandleConfigUpdate(origin, params); }).detach(); | ||||
| 	std::thread([origin, params, listener]() { | ||||
| 		try { | ||||
| 			listener->HandleConfigUpdate(origin, params); | ||||
| 		} catch (const std::exception& ex) { | ||||
| 			auto msg ("Exception during config sync: " + DiagnosticInformation(ex)); | ||||
| 
 | ||||
| 			Log(LogCritical, "ApiListener") << msg; | ||||
| 			listener->UpdateLastFailedZonesStageValidation(msg); | ||||
| 		} | ||||
| 	}).detach(); | ||||
| 	return Empty; | ||||
| } | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user