-
Notifications
You must be signed in to change notification settings - Fork 579
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[dev.icinga.com #10655] API queries cause memory leaks #3677
Comments
Updated by mfriedrich on 2015-11-25 14:25:25 00:00
|
Updated by jonan on 2015-11-28 08:13:56 00:00 I can also confirm resource exhaustion using the API when running the following Icinga environment: Icinga version: v2.4.1-42-g6a83703 on Ubuntu 14.04 Hitting any api call seems to do it. You can reproduce as follows: Monitor the Icinga thread count with:
Query API using Apache bench:
Icinga dies after hitting the max processes limit of 16384. Logs show the following errors when failure begins:
|
Updated by mfriedrich on 2015-11-30 16:59:20 00:00
I'm able to reproduce the issue, though I need to look into it in deep when other projects are finished.
|
Updated by mfriedrich on 2015-12-15 11:10:54 00:00
|
Updated by mfriedrich on 2015-12-18 11:22:03 00:00
|
Updated by peikk0 on 2016-01-07 12:14:46 00:00 I have the same issue on FreeBSD 10.2 with version 2.4.1 |
Updated by mfriedrich on 2016-01-11 13:05:58 00:00
We should fix that, though I currently don't have an idea how to do it. Will discuss that for 2.5 at least. |
Updated by gbeutner on 2016-01-13 09:31:16 00:00
|
Updated by Anonymous on 2016-01-13 09:31:24 00:00
Applied in changeset 7f4af89. |
Updated by gbeutner on 2016-01-13 09:31:45 00:00 Please re-test this against the current Git master. |
Updated by mfriedrich on 2016-01-13 09:55:09 00:00
The thread count stays the same after stopping the requests. Needs further investigation.
|
Updated by mfriedrich on 2016-01-22 15:58:53 00:00
|
Updated by mfriedrich on 2016-01-25 10:34:21 00:00
|
Updated by mfriedrich on 2016-01-27 09:34:50 00:00
|
Updated by mfriedrich on 2016-01-28 14:48:37 00:00
|
Updated by mfriedrich on 2016-01-28 14:48:50 00:00
|
Updated by Anonymous on 2016-02-03 09:05:04 00:00
Applied in changeset 2dc385e. |
Updated by mfriedrich on 2016-02-03 11:38:16 00:00
There's still an existing reference to the HttpServerConnection object. Tests
Debug
at /usr/include/boost/bind/bind.hpp:253
(gdb) c Breakpoint 2, icinga::TlsStream::OnEvent (this=0x7fffe8004bc0, revents=1) at /root/coding/icinga2/lib/base/tlsstream.cpp:132
at /usr/include/boost/bind/bind.hpp:253
(gdb) c Breakpoint 1, icinga::TlsStream::OnEvent (this=0x7fffe8004bc0, revents=1) at /root/coding/icinga2/lib/base/tlsstream.cpp:209 Breakpoint 4, icinga::HttpServerConnection::DataAvailableHandler (this=0x7fffe8008470) at /root/coding/icinga2/lib/remote/httpserverconnection.cpp:199
at /usr/include/boost/bind/mem_fn_template.hpp:40
199 bool close = false; [2016-02-03 10:39:04 0000] warning/PluginCheckTask: Check command for object 'e4e752bf970b!load' (PID: 23660, arguments: '/usr/lib/nagios/plugins/check_load' '-c' '10,6,4' '-w' '5,4,3') terminated with exit code 128, output: execvpe(/usr/lib/nagios/plugins/check_load) failed: No such file or directory [2016-02-03 10:39:04 0000] warning/PluginCheckTask: Check command for object 'e4e752bf970b!ssh' (PID: 23667, arguments: '/usr/lib/nagios/plugins/check_ssh' '127.0.0.1') terminated with exit code 128, output: [2016-02-03 10:39:04 0000] warning/PluginCheckTask: Check command for object 'e4e752bf970b!disk /' (PID: 23673, arguments: '/usr/lib/nagios/plugins/check_disk' '-c' '10' '-w' '20' '-K' '10' '-W' '20' '-X' 'none' '-X' 'tmpfs' '-X' 'sysfs' '-X' 'proc' '-X' 'devtmpfs' '-X' 'devfs' '-X' 'mtmfs' '-m' '-p' '/') terminated with exit code 128, output: execvpe(/usr/lib/nagios/plugins/check_disk) failed: No such file or directory [2016-02-03 10:39:04 0000] warning/PluginCheckTask: Check command for object 'e4e752bf970b!users' (PID: 23680, arguments: '/usr/lib/nagios/plugins/check_users' '-c' '50' '-w' '20') terminated with exit code 128, output: execvpe(/usr/lib/nagios/plugins/check_users) failed: No such file or directory Detaching after fork from child process 23681. [2016-02-03 10:39:04 0000] warning/PluginCheckTask: Check command for object 'e4e752bf970b' (PID: 23676, arguments: '/usr/lib/nagios/plugins/check_ping' '-H' '127.0.0.1' '-c' '5000,100' '-w' '3000,80') terminated with exit code 128, output: execvpe(/usr/lib/nagios/plugins/check_ping) failed: No such file or directory [2016-02-03 10:39:04 0000] warning/PluginCheckTask: Check command for object 'e4e752bf970b!ping6' (PID: 23681, arguments: '/usr/lib/nagios/plugins/check_ping' '-6' '-H' '::1' '-c' '200,15' '-w' '100,5') terminated with exit code 128, output: execvpe(/usr/lib/nagios/plugins/check_ping) failed: No such file or directory [2016-02-03 10:39:04 0000] warning/PluginCheckTask: Check command for object 'e4e752bf970b!ping4' (PID: 23682, arguments: '/usr/lib/nagios/plugins/check_ping' '-4' '-H' '127.0.0.1' '-c' '200,15' '-w' '100,5') terminated with exit code 128, output: execvpe(/usr/lib/nagios/plugins/check_ping) failed: No such file or directory 78 ApiListener::Ptr listener = ApiListener::GetInstance();
at /usr/include/boost/bind/mem_fn_template.hpp:40
at /usr/include/boost/bind/mem_fn_template.hpp:55
at /usr/include/boost/function/function_template.hpp:767
args=std::tuple containing = {...}) at /usr/include/boost/signals2/detail/variadic_slot_invoker.hpp:89
at /usr/include/boost/signals2/detail/variadic_slot_invoker.hpp:78
(boost::shared_ptr<boost::signals2::detail::connection_body<std::pair<boost::signals2::detail::slot_meta_group, boost::optional >, boost::signals2::slot<void(const boost::intrusive_ptricinga::Stream&), boost::function<void(const boost::intrusive_ptricinga::Stream&)> >, boost::signals2::mutex> >) (count 1, weak count 1) 0x7fffe8004ab0) at /usr/include/boost/signals2/detail/variadic_slot_invoker.hpp:114
(boost::shared_ptr<boost::signals2::detail::connection_body<std::pair<boost::signals2::detail::slot_meta_group, boost::optional >, boost::signals2::slot<void(const boost::intrusive_ptricinga::Stream&), boost::function<void(const boost::intrusive_ptricinga::Stream&)> >, boost::signals2::mutex> >) (count 1, weak count 1) 0x7fffe8004ab0) at /usr/include/boost/signals2/detail/variadic_slot_invoker.hpp:107
--
at /usr/include/boost/signals2/detail/result_type_wrapper.hpp:64
args#0=(boost::intrusive_ptricinga::Stream) 0x7fffe8004bc0) at /usr/include/boost/signals2/detail/signal_template.hpp:246
args#0=(boost::intrusive_ptricinga::Stream) 0x7fffe8004bc0) at /usr/include/boost/signals2/detail/signal_template.hpp:695
at /usr/include/boost/bind/bind.hpp:253
--
(gdb) frame 20
335 SignalDataAvailable();
217 Disconnect();
335 SignalDataAvailable(); Breakpoint 5, icinga::TlsStream::CloseInternal (this=0x7fffe8004bc0, inDestructor=false) at /root/coding/icinga2/lib/base/tlsstream.cpp:337
at /usr/include/boost/bind/bind.hpp:253
(gdb) l Breakpoint 3, icinga::Stream::Close (this=0x7fffe8004bc0) at /root/coding/icinga2/lib/base/stream.cpp:81
at /usr/include/boost/bind/bind.hpp:253
(gdb) n |
Updated by mfriedrich on 2016-02-03 11:38:23 00:00 ResearchRegisterDataAvailableHandler, OnDataAvailable() The older fix works on OSX (boost 1.59 ) but not RHEL7 (boost 1.53)
|
Updated by mfriedrich on 2016-02-03 11:54:18 00:00 http://stackoverflow.com/questions/2049291/force-deletion-of-slot-in-boostsignals2 |
Updated by mfriedrich on 2016-02-03 12:48:04 00:00 Using the fix from caf3380
|
Updated by mfriedrich on 2016-02-03 12:56:37 00:00 Affects boost versions > 1.49 and < 1.59 (e.g. RHEL 7). |
Updated by mfriedrich on 2016-02-03 12:56:49 00:00
|
Updated by mfriedrich on 2016-02-03 14:13:58 00:00
|
Updated by mfriedrich on 2016-02-04 09:08:35 00:00
|
Updated by mfriedrich on 2016-02-04 12:43:39 00:00 https://svn.boost.org/trac/boost/ticket/8533 |
Updated by mfriedrich on 2016-02-08 08:59:32 00:00
|
Updated by gbeutner on 2016-02-23 09:58:18 00:00
|
This issue has been migrated from Redmine: https://dev.icinga.com/issues/10655
Created by vvv on 2015-11-17 01:30:28 00:00
Assignee: mfriedrich
Status: Resolved (closed on 2016-02-03 12:56:49 00:00)
Target Version: 2.4.2
Last Update: 2016-02-23 09:58:18 00:00 (in Redmine)
API Query opens threads but the thread does not die after the api query is done.
Checking for icinga2 threads:
icinga@icinga-np:/home/vvv$ for i in {1..100000}; do ps -eLf | grep "no-stack" | wc -l; sleep 5; done
17
17
17
17
17
17
17
22
32
42
52
62
72
82
84
84
84
84
84
84
84
84
84
84
84
84
84
84
84
84
84
84
84
84
84
84
84
84
84
85
85
85
85
85
85
85
86
86
86
86
86
86
86
86
86
86
87
87
87
87
87
87
91
94
97
100
103
107
110
113
116
119
123
Query used for API
VVV-MacBook-Pro:~ vvv$ for i in {1..100000};do curl -k https://root:icinga@icinga-np:5665/v1/objects/hosts?host=icinga-np; done
After killing the continuous curl call the thread count went steady at 123.
Changesets
2016-01-13 09:30:38 00:00 by (unknown) 7f4af89
2016-02-03 08:54:31 00:00 by (unknown) 2dc385e
2016-02-03 11:58:49 00:00 by (unknown) cfe9849
2016-02-03 12:02:49 00:00 by (unknown) caf3380
2016-02-23 08:38:05 00:00 by (unknown) b6a799d
2016-02-23 08:38:23 00:00 by (unknown) 9a0107d
2016-02-23 08:38:24 00:00 by (unknown) 8af6ad7
Relations:
The text was updated successfully, but these errors were encountered: