Check-in [2c4afb1176]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:MFT: Fix json building at exit by using the same check for bulk/testport as err()
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | 3.0.x
Files: files | file ages | folders
SHA1: 2c4afb117632adeb054bc35878305b0231d1183f
User & Date: bdrewery 2013-05-27 15:26:50
Context
2013-05-28
15:04
MFT: jail -sk: Validate ports tree exists check-in: a63e367ce4 user: bdrewery tags: 3.0.x
2013-05-27
15:26
MFT: Fix json building at exit by using the same check for bulk/testport as err() check-in: 2c4afb1176 user: bdrewery tags: 3.0.x
2013-05-25
02:07
MFT: status: Don't register EXIT_STATUS in the build check-in: d0a15be205 user: bdrewery tags: 3.0.x
Changes

Changes to src/share/poudriere/common.sh.

27
28
29
30
31
32
33





34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
...
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
# SUCH DAMAGE.

# zfs namespace
NS="poudriere"
IPS="$(sysctl -n kern.features.inet 2>/dev/null || echo 0)$(sysctl -n kern.features.inet6 2>/dev/null || echo 0)"
RELDATE=$(sysctl -n kern.osreldate)
JAILED=$(sysctl -n security.jail.jailed)






err() {
	export CRASHED=1
	if [ $# -ne 2 ]; then
		err 1 "err expects 2 arguments: exit_number \"message\""
	fi
	# Try to set status so other processes know this crashed
	# Don't set it from children failures though, only master
	[ -z "${PARALLEL_CHILD}" ] &&
		[ "${0##*/}" = "bulk.sh" \
		-o "${0##*/}" = "testport.sh" ] &&
		bset status "${EXIT_STATUS:-crashed:}" 2>/dev/null || :
	local err_msg="Error: $2"
	msg "${err_msg}" >&2
	[ -n "${MY_JOBID}" ] && job_msg "${err_msg}"
	exit $1
}

................................................................................

exit_handler() {
	# Avoid recursively cleaning up here
	trap - EXIT SIGTERM SIGKILL
	# Ignore SIGINT while cleaning up
	trap '' SIGINT

	if [ ${STATUS} -eq 1 ] && [ "${POUDRIERE_BUILD_TYPE}" = "bulk" \
		-o "${POUDRIERE_BUILD_TYPE}" = "testport" ]; then
		log_stop
		stop_html_json
	fi

	parallel_shutdown

	[ ${STATUS} -eq 1 ] && cleanup







>
>
>
>
>








|
<
<







 







|
<







27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47


48
49
50
51
52
53
54
...
312
313
314
315
316
317
318
319

320
321
322
323
324
325
326
# SUCH DAMAGE.

# zfs namespace
NS="poudriere"
IPS="$(sysctl -n kern.features.inet 2>/dev/null || echo 0)$(sysctl -n kern.features.inet6 2>/dev/null || echo 0)"
RELDATE=$(sysctl -n kern.osreldate)
JAILED=$(sysctl -n security.jail.jailed)

# Return true if ran from bulk/testport, ie not daemon/status/jail
was_a_bulk_run() {
	[ "${0##*/}" = "bulk.sh" -o "${0##*/}" = "testport.sh" ]
}

err() {
	export CRASHED=1
	if [ $# -ne 2 ]; then
		err 1 "err expects 2 arguments: exit_number \"message\""
	fi
	# Try to set status so other processes know this crashed
	# Don't set it from children failures though, only master
	[ -z "${PARALLEL_CHILD}" ] && was_a_bulk_run &&


		bset status "${EXIT_STATUS:-crashed:}" 2>/dev/null || :
	local err_msg="Error: $2"
	msg "${err_msg}" >&2
	[ -n "${MY_JOBID}" ] && job_msg "${err_msg}"
	exit $1
}

................................................................................

exit_handler() {
	# Avoid recursively cleaning up here
	trap - EXIT SIGTERM SIGKILL
	# Ignore SIGINT while cleaning up
	trap '' SIGINT

	if was_a_bulk_run; then

		log_stop
		stop_html_json
	fi

	parallel_shutdown

	[ ${STATUS} -eq 1 ] && cleanup