Pawel Jakub Dawidek
ff6bb1f8b3
- Move functionality responsible for checking one connection to separate
...
function to make code more readable.
- Be sure not to reconnect too often in case of signal delivery, etc.
MFC after: 2 weeks
Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com
2010-08-29 22:55:21 +00:00
Pawel Jakub Dawidek
ee087cdf97
Disconnect after logging errors.
...
MFC after: 2 weeks
Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com
2010-08-29 22:17:53 +00:00
Pawel Jakub Dawidek
a870e771b9
- Call hook on role change.
...
- Document new event.
MFC after: 2 weeks
Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com
2010-08-29 21:42:45 +00:00
Pawel Jakub Dawidek
ecc99c890e
Allow to run hooks from the main hastd process.
...
MFC after: 2 weeks
Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com
2010-08-29 21:41:53 +00:00
Pawel Jakub Dawidek
25ec2e3e2b
- Add hook_fini() which should be called after fork() from the main hastd
...
process, once it start to use hooks.
- Add hook_check_one() in case the caller expects different child processes
and once it can recognize it, it will pass pid and status to hook_check_one().
MFC after: 2 weeks
Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com
2010-08-29 21:39:49 +00:00
Pawel Jakub Dawidek
572cdb2216
Implement mtx_destroy() and rw_destroy().
...
MFC after: 2 weeks
Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com
2010-08-29 21:37:21 +00:00
Pawel Jakub Dawidek
5da2320932
When SIGTERM or SIGINT is received, terminate worker processes.
...
MFC after: 2 weeks
Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com
2010-08-27 21:28:02 +00:00
Pawel Jakub Dawidek
4767ee29f1
When logging to stdout/stderr, flush after each log.
...
MFC after: 2 weeks
Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com
2010-08-27 21:26:55 +00:00
Pawel Jakub Dawidek
b9cf0cf5fa
Correct when we log interrupted synchronization.
...
MFC after: 2 weeks
Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com
2010-08-27 21:20:32 +00:00
Pawel Jakub Dawidek
eba09893fd
Check if no signals were delivered just before going to sleep.
...
MFC after: 2 weeks
Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com
2010-08-27 20:49:06 +00:00
Pawel Jakub Dawidek
01125a9381
Add hooks execution.
...
MFC after: 2 weeks
Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com
2010-08-27 20:48:12 +00:00
Pawel Jakub Dawidek
ac59403c39
Document new 'exec' parameter.
...
MFC after: 2 weeks
Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com
2010-08-27 15:20:31 +00:00
Pawel Jakub Dawidek
0becad39a7
Allow to execute specified program on various HAST events.
...
MFC after: 2 weeks
Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com
2010-08-27 15:16:52 +00:00
Pawel Jakub Dawidek
1cdaf10c45
- Run hooks in background - don't block waiting for them to finish.
...
- Keep all hooks we're running in a global list, so we can report when
they finish and also report when they are running for too long.
MFC after: 2 weeks
Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com
2010-08-27 14:38:12 +00:00
Pawel Jakub Dawidek
e64887c4d6
When logging to stdout/stderr don't close those descriptors after fork().
...
MFC after: 2 weeks
Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com
2010-08-27 14:35:39 +00:00
Pawel Jakub Dawidek
3f828c18e5
Reduce indent where possible.
...
MFC after: 2 weeks
Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com
2010-08-27 14:28:39 +00:00
Pawel Jakub Dawidek
f7fe83f9f8
Implement keepalive mechanism inside HAST protocol so we can detect secondary
...
node failures quickly for HAST resources that are rarely modified.
Remove XXX from a comment now that the guard thread never sleeps infinitely.
MFC after: 2 weeks
Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com
2010-08-27 14:26:37 +00:00
Pawel Jakub Dawidek
8f8c798c13
- Remove redundant and incorrect 'old' word from debug message.
...
- Log disconnects as warnings.
MFC after: 2 weeks
Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com
2010-08-27 14:12:53 +00:00
Pawel Jakub Dawidek
e23d2d0187
Don't increase number synchronized bytes in case of an error.
...
MFC after: 2 weeks
Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com
2010-08-27 14:10:25 +00:00
Pawel Jakub Dawidek
53d9b386eb
Log that synchronization was interrupted in a proper place.
...
MFC after: 2 weeks
Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com
2010-08-27 14:08:10 +00:00
Pawel Jakub Dawidek
55ce1e7c8b
We have sync_start() function to start synchronization, introduce sync_stop()
...
function to stop it.
MFC after: 2 weeks
Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com
2010-08-27 14:06:00 +00:00
Pawel Jakub Dawidek
16bd7026a2
Add QUEUE_INSERT() and QUEUE_TAKE() macros that simplify the code a bit.
...
MFC after: 2 weeks
Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com
2010-08-27 14:01:28 +00:00
Pawel Jakub Dawidek
6e5f008ac4
Add mtx_owned() implementation.
...
MFC after: 2 weeks
Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com
2010-08-27 13:58:38 +00:00
Pawel Jakub Dawidek
7087d13fae
Make comment more readable.
...
MFC after: 2 weeks
Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com
2010-08-27 13:54:17 +00:00
Pawel Jakub Dawidek
28df1f238a
For some setups sending data in 128kB chunks makes communication very slow. No
...
idea why. 32kB on the other hand seems to work properly everywhere.
Reported by: Thomas Steen Rasmussen <thomas@gibfest.dk>
MFC after: 3 weeks
2010-08-18 12:09:27 +00:00
Pawel Jakub Dawidek
471bb09914
The 'size' variable is there to limit how many bytes we want to copy from
...
'addr'. It is very likely that size of 'addr' is larger than 'size', so checking
strlcpy() return value is bogus.
MFC after: 3 weeks
2010-08-16 21:59:56 +00:00
Joel Dahl
c2025a7660
Fix typos, spelling, formatting and mdoc mistakes found by Nobuyuki while
...
translating these manual pages. Minor corrections by me.
Submitted by: Nobuyuki Koganemaru <n-kogane@syd.odn.ne.jp>
2010-08-16 15:18:30 +00:00
Pawel Jakub Dawidek
44d63cff2e
Document 'none' value for remote.
...
Reviewed by: dougb
MFC after: 1 month
2010-08-05 19:54:57 +00:00
Pawel Jakub Dawidek
0989854d45
Implement configuration reload on SIGHUP. This includes:
...
- Load added resources.
- Stop and forget removed resources.
- Update modified resources in least intrusive way, ie. don't touch
/dev/hast/<name> unless path to local component or provider name were
modified.
Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com
MFC after: 1 month
2010-08-05 19:16:31 +00:00
Pawel Jakub Dawidek
bbbb114cda
Prepare configuration parsing code to be called multiple times:
...
- Don't exit on errors if not requested.
- Don't keep configuration in global variable, but allocate memory for
configuration.
- Call yyrestart() before yyparse() so that on error in configuration file
we will start from the begining next time and not from the place we left of.
MFC after: 1 month
2010-08-05 19:08:54 +00:00
Pawel Jakub Dawidek
a00829bb71
Make control_set_role() more public. We will need it soon.
...
MFC after: 1 month
2010-08-05 19:04:29 +00:00
Pawel Jakub Dawidek
f377917cdc
Allow to use 'none' keywork as remote address in case second cluster node
...
is not setup yet.
MFC after: 1 month
2010-08-05 19:01:57 +00:00
Pawel Jakub Dawidek
a2ef0636b4
Reset signal handlers after fork().
...
MFC after: 1 month
2010-08-05 18:58:00 +00:00
Pawel Jakub Dawidek
005f438bf5
- Use pjdlog_exitx() to log errors and exit instead of errx().
...
- Use 'unable to' (instead of 'cannot') consistently.
MFC after: 1 month
2010-08-05 18:56:24 +00:00
Pawel Jakub Dawidek
2c5dadc9cf
Assert that various buffers we are large enough.
...
MFC after: 1 month
2010-08-05 18:27:41 +00:00
Pawel Jakub Dawidek
524840d8d0
Problem with assertion is that it logs on stderr. Add two macros:
...
PJDLOG_ASSERT() and PJDLOG_VERIFY() that will check the given condition
and log the problem where appropriate. The difference between those
two is that PJDLOG_VERIFY() always work and PJDLOG_ASSERT() can be
turned off by defining NDEBUG.
MFC after: 1 month
2010-08-05 18:26:38 +00:00
Pawel Jakub Dawidek
6b97e48326
Keep $FreeBSD$ in __FBSDID() only for C files.
...
MFC after: 1 month
2010-08-05 18:23:43 +00:00
Pawel Jakub Dawidek
e3031161eb
Mark two more places that we won't reach.
...
MFC after: 1 month
2010-08-05 18:21:45 +00:00
Pawel Jakub Dawidek
9bf24e1a00
Now that TCP will be checked last we don't need any knowledge about other
...
protocols.
MFC after: 1 month
2010-08-05 17:57:59 +00:00
Pawel Jakub Dawidek
50692f84c6
Add an argument to the proto_register() function which allows protocol to
...
declare it is the default and be placed at the end of the queue so it is
checked last.
MFC after: 1 month
2010-08-05 17:56:41 +00:00
Joel Dahl
a53bb70bda
Spelling fixes.
2010-07-31 21:09:49 +00:00
Pawel Jakub Dawidek
1a517c3ec5
Actually, only the fullsync mode is implemented, not memsync mode.
...
Correct manual page.
MFC after: 3 days
2010-07-22 08:30:14 +00:00
Pawel Jakub Dawidek
f3bd74124a
Correct various log messages.
...
Submitted by: Mikolaj Golub <to.my.trociny@gmail.com>
MFC after: 3 days
2010-06-14 21:46:48 +00:00
Pawel Jakub Dawidek
96610dd9b6
Fix typos.
...
MFC after: 3 days
2010-06-14 21:44:58 +00:00
Pawel Jakub Dawidek
328e0f4b04
Initialize gctl_seq for synchronization requests.
...
Reported by: hiroshi@soupacific.com
Analysed by: Mikolaj Golub <to.my.trociny@gmail.com>
Tested by: hiroshi@soupacific.com , Mikolaj Golub <to.my.trociny@gmail.com>
MFC after: 3 days
2010-06-14 21:44:20 +00:00
Pawel Jakub Dawidek
7a716e072e
Plug memory leak.
...
Found by: Coverity Prevent
CID: 7057
MFC after: 3 days
2010-06-14 21:41:22 +00:00
Pawel Jakub Dawidek
b0dfbe5b27
Plug memory leak.
...
Found by: Coverity Prevent
CID: 7056
MFC after: 3 days
2010-06-14 21:37:25 +00:00
Pawel Jakub Dawidek
9f31eddba0
Plug memory leak.
...
Found by: Coverity Prevent
CID: 7051
MFC after: 3 days
2010-06-14 21:33:18 +00:00
Pawel Jakub Dawidek
6744284aec
Plug memory leaks.
...
Found by: Coverity Prevent
CID: 7052, 7053, 7054, 7055
MFC after: 3 days
2010-06-14 21:25:20 +00:00
Pawel Jakub Dawidek
9fab3c1b94
Remove macros that are not really needed. The idea was to have them in case
...
we grow more descriptors, but I'll reconsider readding them once we get there.
Passing (a = b) expression to FD_ISSET() is bad idea, as FD_ISSET() evaluates
its argument twice.
Found by: Coverity Prevent
CID: 5243
MFC after: 3 days
2010-06-14 21:18:58 +00:00