root/src/noit_config.h.in

Revision 79a202d1206b8023b5e722f3065b03946be0d7d5, 6.8 kB (checked in by Theo Schlossnagle <jesus@omniti.com>, 4 months ago)

Strive for usable core dumps.

Noits are busy, they have much to do. When they crash, the parent will
run a glider if configured against the child and then "wait" for it to
finish crashing. The default wait time is 5 second and can be configured
via the WATCHDOG_TIMEOUT environment variable. However, we somteime see
(on heavy instances) a 10 minute core dump time. This poses a serious issue.

Even if the timeout is set that high, the binary will have open descriptors
and locks that prevent another to be launched in its place. The whole point
of the timeout is to make sure we're not out-of-service for too long.

This commit provides a new option (and new default) where (at least on
Illumos) the child will suspend peer threads and close fds to allow the dump
to happen asynchronously to the parent starting a new replacement process.
It can be disabled by setting ASYNCH_CORE_DUMP=0 in the environment.

Linux support should be added.

  • Property mode set to 100644
Line 
1 /*
2  * Copyright (c) 2005-2009, OmniTI Computer Consulting, Inc.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are
7  * met:
8  *
9  *    * Redistributions of source code must retain the above copyright
10  *      notice, this list of conditions and the following disclaimer.
11  *    * Redistributions in binary form must reproduce the above
12  *      copyright notice, this list of conditions and the following
13  *      disclaimer in the documentation and/or other materials provided
14  *      with the distribution.
15  *    * Neither the name OmniTI Computer Consulting, Inc. nor the names
16  *      of its contributors may be used to endorse or promote products
17  *      derived from this software without specific prior written
18  *      permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32
33 #ifndef __NOIT_CONFIG_H
34 #define __NOIT_CONFIG_H
35
36 /* define inline unless that is what the compiler already calls it. */
37 #undef inline
38
39 #undef DTRACE_ENABLED
40 #ifndef DTRACE_ENABLED
41 #define DTRACE_PROBES_DISABLED 1
42 #endif
43 #undef MODULEEXT
44 #undef MODULES_DIR
45 #undef DEFAULT_EVENTER
46 #undef ETC_DIR
47
48 #undef HAVE_FCNTL_H
49 #undef HAVE_UNISTD_H
50 #undef HAVE_SYS_TYPES_H
51 #undef HAVE_SYS_WAIT_H
52 #undef HAVE_TERM_H
53 #undef HAVE_TERMIO_H
54 #undef HAVE_TERMIOS_H
55 #undef TPUTS_TAKES_CHAR
56 #undef TGOTO_TAKES_CHAR
57 #undef HAVE_SYS_IOCTL_COMPAT_H
58 #undef HAVE_SYS_IOCTL_H
59 #undef HAVE_SYS_FILIO_H
60 #undef HAVE_STROPTS_H
61 #undef HAVE_SYS_STREAM_H
62 #undef HAVE_UTIL_H
63 #undef HAVE_BSD_LIBUTIL_H
64 #undef HAVE_LIBUTIL_H
65 #undef HAVE_CURSES_H
66 #undef HAVE_DIRENT_H
67 #undef HAVE_PWD_H
68 #undef HAVE_PTY_H
69 #undef HAVE_ERRNO_H
70 #undef HAVE_STRING_H
71 #undef HAVE_STDLIB_H
72 #undef HAVE_SYS_PARAM_H
73 #undef HAVE_SEMAPHORE_H
74 #undef HAVE_ALLOCA_H
75 #undef HAVE_TIME_H
76 #undef HAVE_SYS_STAT_H
77 #undef HAVE_SYS_RESOURCE_H
78 #undef HAVE_SYS_CDEFS_H
79 #undef HAVE_LIBKERN_OSATOMIC_H
80 #undef HAVE_NETINET_IN_SYSTM_H
81 #undef HAVE_POSIX_READDIR_R
82 #undef HAVE_MYSQL_H
83 #undef HAVE_MYSQL_MYSQL_H
84 #undef HAVE_INT64_T
85 #undef HAVE_INTXX_T
86 #undef HAVE_LONG_LONG_INT
87 #undef HAVE_UINTXX_T
88 #undef HAVE_U_INT
89 #undef HAVE_U_INT64_T
90 #undef HAVE_U_INTXX_T
91 #undef HAVE_SIG_T
92 #undef HAVE_UUID_UNPARSE_LOWER
93 #define IFS_CH '/'
94 #undef WORKING_SEM_INIT
95 #undef HAVE_GCRYPT_H
96
97 #undef HAVE_FDWALK
98 #undef HAVE_GETPWNAM_R
99 #undef HAVE_GETPWNAM_R_POSIX
100 #undef HAVE_GETGRNAM_R
101 #undef HAVE_GETGRNAM_R_POSIX
102
103 #ifdef HAVE_STRING_H
104 #include <string.h>
105 #endif
106 #ifdef HAVE_STDLIB_H
107 #include <stdlib.h>
108 #endif
109 #ifdef HAVE_SYS_PARAM_H
110 #include <sys/param.h>
111 #endif
112 #ifdef HAVE_SYS_TYPES_H
113 #include <sys/types.h>
114 #endif
115 #ifdef HAVE_SYS_STAT_H
116 #include <sys/stat.h>
117 #endif
118 #ifdef HAVE_SYS_RESOURCE_H
119 #include <sys/resource.h>
120 #endif
121 #ifdef HAVE_ALLOCA_H
122 #include <alloca.h>
123 #endif
124
125 #undef HAVE_ISSETUGID
126 #undef HAVE_STRLCPY
127 #undef HAVE_STRLCAT
128 #undef HAVE_STRNSTRN
129 #undef HAVE_OPENPTY
130 #undef HAVE_DECL_OPENPTY
131 #undef HAVE_INET_PTON
132 #undef HAVE_INET_NTOP
133 #undef HAVE_GETOPT
134 #undef HAVE_POLL
135 #undef HAVE_VASPRINTF
136
137 /* Kernel kqueue() support */
138 #undef HAVE_KQUEUE
139 /* Kernel epoll_create() support */
140 #undef HAVE_EPOLL
141 /* Kernel port_create() support */
142 #undef HAVE_PORTS
143
144 /* The number of bytes in a char.  */
145 #undef SIZEOF_CHAR
146
147 /* The number of bytes in a int.  */
148 #undef SIZEOF_INT
149
150 /* The number of bytes in a size_t.  */
151 #undef SIZEOF_SIZE_T
152
153
154 /* The number of bytes in a long int.  */
155 #undef SIZEOF_LONG_INT
156
157 /* The number of bytes in a long long int.  */
158 #undef SIZEOF_LONG_LONG_INT
159
160 /* The number of bytes in a short int.  */
161 #undef SIZEOF_SHORT_INT
162
163 /* The number of bytes in a void *.  */
164 #undef SIZEOF_VOID_P
165
166 /* The number of bytes in a void * (workaround for OpenBSD). */
167 #undef SIZEOF_VOID__
168 #if !defined(SIZEOF_VOID_P) && defined(SIZEOF_VOID__)
169 #  define SIZEOF_VOID_P SIZEOF_VOID__
170 #endif
171
172 #ifndef HAVE_U_INT
173 #define HAVE_U_INT
174 typedef unsigned int u_int;
175 #endif
176
177 #undef HAVE_INTXX_T
178 #ifndef HAVE_INTXX_T
179 #if (SIZEOF_CHAR == 1)
180 typedef char int8_t;
181 #else
182 #error "8 bit int type not found."
183 #endif
184 #if (SIZEOF_SHORT_INT == 2)
185 typedef short int int16_t;
186 #else
187 #ifdef _CRAY
188 typedef long int16_t;
189 #else
190 #warning "16 bit int type not found."
191 #endif /* _CRAY */
192 #endif
193 #if (SIZEOF_INT == 4)
194 typedef int int32_t;
195 #else
196 #ifdef _CRAY
197 typedef long int32_t;
198 #else
199 #error "32 bit int type not found."
200 #endif /* _CRAY */
201 #endif
202 #endif
203
204 /* If sys/types.h does not supply u_intXX_t, supply them ourselves */
205 #ifndef HAVE_U_INTXX_T
206 #ifdef HAVE_UINTXX_T
207 typedef uint8_t u_int8_t;
208 typedef uint16_t u_int16_t;
209 typedef uint32_t u_int32_t;
210 #define HAVE_U_INTXX_T 1
211 #else
212 #if (SIZEOF_CHAR == 1)
213 typedef unsigned char u_int8_t;
214 #else
215 #error "8 bit int type not found."
216 #endif
217 #if (SIZEOF_SHORT_INT == 2)
218 typedef unsigned short int u_int16_t;
219 #else
220 #ifdef _CRAY
221 typedef unsigned long u_int16_t;
222 #else
223 #warning "16 bit int type not found."
224 #endif
225 #endif
226 #if (SIZEOF_INT == 4)
227 typedef unsigned int u_int32_t;
228 #else
229 #ifdef _CRAY
230 typedef unsigned long u_int32_t;
231 #else
232 #error "32 bit int type not found."
233 #endif
234 #endif
235 #endif
236 #endif
237
238 /* 64-bit types */
239 #ifndef HAVE_INT64_T
240 #if (SIZEOF_LONG_INT == 8)
241 typedef long int int64_t;
242 #define HAVE_INT64_T 1
243 #else
244 #if (SIZEOF_LONG_LONG_INT == 8)
245 typedef long long int int64_t;
246 #define HAVE_INT64_T 1
247 #define HAVE_LONG_LONG_INT
248 #endif
249 #endif
250 #endif
251 #ifndef HAVE_U_INT64_T
252 #if (SIZEOF_LONG_INT == 8)
253 typedef unsigned long int u_int64_t;
254 #define HAVE_U_INT64_T 1
255 #else
256 #if (SIZEOF_LONG_LONG_INT == 8)
257 typedef unsigned long long int u_int64_t;
258 #define HAVE_U_INT64_T 1
259 #endif
260 #endif
261 #endif
262
263 /* BIND, Kerberos and Berkeley DB use __BIT_TYPES_DEFINED__ to protect
264  * against multiple redefinitions of these types (u_int{8,16,32,64}_t)
265  * and so shall we.
266  */
267 #ifndef __BIT_TYPES_DEFINED__
268 #define __BIT_TYPES_DEFINED__
269 #endif
270
271 #if (SIZEOF_VOID_P == 8)
272 typedef u_int64_t vpsized_uint;
273 typedef int64_t vpsized_int;
274 #elif (SIZEOF_VOID_P == 4)
275 typedef u_int32_t vpsized_uint;
276 typedef int32_t vpsized_int;
277 #else
278 #error Unsupported size of void ptr
279 #endif
280
281 #ifndef PATH_MAX
282 #define PATH_MAX MAXPATHLEN
283 #endif
284
285 typedef enum { noit_false = 0, noit_true } noit_boolean;
286
287 #undef UNAME_V
288 #undef UNAME_R
289 #undef UNAME_S
290 #undef UNAME_M
291 #undef UNAME_N
292 #undef UNAME_P
293
294 #endif
Note: See TracBrowser for help on using the browser.