"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "lib/base/io-engine.hpp" between
icinga2-2.11.5.tar.gz and icinga2-2.12.0.tar.gz

About: Icinga 2 is an enterprise grade monitoring system which keeps watch over networks and any conceivable network resource.

io-engine.hpp  (icinga2-2.11.5):io-engine.hpp  (icinga2-2.12.0)
skipping to change at line 90 skipping to change at line 90
static IoEngine& Get(); static IoEngine& Get();
boost::asio::io_context& GetIoContext(); boost::asio::io_context& GetIoContext();
static inline size_t GetCoroutineStackSize() { static inline size_t GetCoroutineStackSize() {
#ifdef _WIN32 #ifdef _WIN32
// Increase the stack size for Windows coroutines to prevent exce ption corruption. // Increase the stack size for Windows coroutines to prevent exce ption corruption.
// Rationale: Low cost Windows agent only & https://github.com/Ic inga/icinga2/issues/7431 // Rationale: Low cost Windows agent only & https://github.com/Ic inga/icinga2/issues/7431
return 8 * 1024 * 1024; return 8 * 1024 * 1024;
#else /* _WIN32 */ #else /* _WIN32 */
return boost::coroutines::stack_allocator::traits_type::default_s // Increase the stack size for Linux/Unix coroutines for many JSO
ize(); // Default 64 KB N objects on the stack.
// This may help mitigate possible stack overflows. https://githu
b.com/Icinga/icinga2/issues/7532
return 256 * 1024;
//return boost::coroutines::stack_allocator::traits_type::default
_size(); // Default 64 KB
#endif /* _WIN32 */ #endif /* _WIN32 */
} }
/* With dedicated strand in *Connection classes. */
template <typename Handler, typename Function> template <typename Handler, typename Function>
static void SpawnCoroutine(Handler h, Function f) { static void SpawnCoroutine(Handler& h, Function f) {
boost::asio::spawn(std::forward<Handler>(h), boost::asio::spawn(h,
[f](boost::asio::yield_context yc) {
try {
f(yc);
} catch (const boost::coroutines::detail::forced_
unwind &) {
// Required for proper stack unwinding wh
en coroutines are destroyed.
// https://github.com/boostorg/coroutine/
issues/39
throw;
} catch (const std::exception& ex) {
Log(LogCritical, "IoEngine", "Exception i
n coroutine!");
Log(LogDebug, "IoEngine") << "Exception i
n coroutine: " << DiagnosticInformation(ex);
} catch (...) {
Log(LogCritical, "IoEngine", "Exception i
n coroutine!");
}
},
boost::coroutines::attributes(GetCoroutineStackSize()) //
Set a pre-defined stack size.
);
}
/* Without strand in the IO executor's context. */
template <typename Function>
static void SpawnCoroutine(boost::asio::io_context& io, Function f) {
boost::asio::spawn(io,
[f](boost::asio::yield_context yc) { [f](boost::asio::yield_context yc) {
try { try {
f(yc); f(yc);
} catch (const boost::coroutines::detail::forced_ unwind &) { } catch (const boost::coroutines::detail::forced_ unwind &) {
// Required for proper stack unwinding wh en coroutines are destroyed. // Required for proper stack unwinding wh en coroutines are destroyed.
// https://github.com/boostorg/coroutine/ issues/39 // https://github.com/boostorg/coroutine/ issues/39
throw; throw;
} catch (const std::exception& ex) { } catch (const std::exception& ex) {
Log(LogCritical, "IoEngine", "Exception i n coroutine!"); Log(LogCritical, "IoEngine", "Exception i n coroutine!");
 End of changes. 4 change blocks. 
36 lines changed or deleted 9 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)