Skip to content
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

[pull] master from flux-framework:master #38

Open
wants to merge 10,000 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
10000 commits
Select commit Hold shift + click to select a range
7119eee
kvs: remove treq_iter_request_copies()
chu11 Jan 31, 2025
2f90c13
kvs: no need to cleanup incomplete fences
chu11 Jan 31, 2025
07ee500
kvs: remove unused treq_mgr_iter_transactions()
chu11 Feb 1, 2025
b74ab0f
kvs: remove treq processed flag
chu11 Feb 1, 2025
e9f7fcd
Merge pull request #6595 from chu11/kvs_refactor
mergify[bot] Feb 3, 2025
68cc984
cmd: remove extraneous include in src/cmd/builtin/python.c
grondo Jan 31, 2025
e146893
cmd: save and restore original PYTHONPATH for python subcommands
grondo Jan 31, 2025
8b53c45
cmd: export bultin_env_add_pythonpath() to builtins
grondo Jan 31, 2025
e7801b4
cmd: only prepend to PYTHONPATH in `flux python` and `flux env`
grondo Jan 31, 2025
815f760
doc: update description of `PYTHONPATH` in man pages
grondo Jan 31, 2025
66b45f5
doc: update Python pip usage in Python docs
grondo Jan 31, 2025
edf9d02
doc: remove comment about PYTHONPATH in Python docs
grondo Jan 31, 2025
721844f
testsuite: set PYTHONPATH in sharness.d/01-setup.sh
grondo Feb 1, 2025
f770eff
testsuite: test handling of PYTHONPATH
grondo Jan 31, 2025
fc051b9
Merge pull request #6597 from grondo/issue#6594
mergify[bot] Feb 4, 2025
edd5d1c
doc: reword initial program environment documentation
grondo Feb 4, 2025
11ad017
Merge pull request #6601 from grondo/env-doc-simplify
mergify[bot] Feb 4, 2025
0c1089f
NEWS.md: Add release notes for v0.71.0
grondo Feb 4, 2025
1fbd1dd
Merge pull request #6603 from grondo/news-0.71
mergify[bot] Feb 4, 2025
a806c71
resource: give reslog access to module context
garlick Jan 28, 2025
6318e85
resource: keep resource eventlog events in memory
garlick Jan 27, 2025
f2ac917
resource: add resource.journal RPC
garlick Jan 28, 2025
f5c13fa
resource: post a restart event
garlick Jan 28, 2025
5dbd21a
flux-resource: add eventlog subcommand
garlick Jan 28, 2025
a15e13c
testsuite: cover resource journal
garlick Jan 30, 2025
6769b2e
flux-resource(1): add eventlog subcommand
garlick Jan 30, 2025
496a332
Merge pull request #6586 from garlick/resource_journal
mergify[bot] Feb 6, 2025
93c9bd1
flux-job: don't override `-L, --color` with `-H, --human`
grondo Feb 6, 2025
3a175c2
testsuite: add test for `-HL` behavior in `flux-job(1)`
grondo Feb 6, 2025
34a392f
Merge pull request #6612 from grondo/color-eventlog
mergify[bot] Feb 6, 2025
7b2bde7
docker/README: fix buildx commands to set root
trws Jan 23, 2025
e4fef68
actions: port changes to use native arm runners
trws Jan 23, 2025
9e0650b
matrix: restore fedora40 arm container
trws Jan 24, 2025
2ab4ed3
t/cron-faketime: skip cron faketime t on aarch64
trws Feb 6, 2025
a76d861
Merge pull request #6575 from trws/docker-cleanup
mergify[bot] Feb 7, 2025
45785d0
shell: fail if multiple keys set in tasks count
sam-maloney Feb 5, 2025
def7107
python: require exactly one of total or per_slot
sam-maloney Feb 5, 2025
5fc2041
libjob: require exactly one key in tasks count
sam-maloney Feb 7, 2025
efdc5ba
testsuite: new invalid jobspec task counts
sam-maloney Feb 6, 2025
d9cde83
Merge pull request #6605 from sam-maloney/task-keys
mergify[bot] Feb 7, 2025
5165bd3
kvs: fix comment typos
chu11 Feb 5, 2025
8e6a9e4
kvs/test: check kvsroot corner cases
chu11 Feb 3, 2025
98d64ab
kvs/test: initialize cred before first use
chu11 Feb 4, 2025
f99908e
kvs: remove unused parameter
chu11 Feb 3, 2025
31ac59e
kvs: remove treq flags
chu11 Feb 3, 2025
5e63982
kvs: remove treq_t convenience type
chu11 Feb 4, 2025
1d6bfbc
kvs: use zhash instead of treq_mgr_t in kvsroot
chu11 Feb 7, 2025
77adbaf
kvs: remove treq API
chu11 Feb 7, 2025
74bb8ae
Merge pull request #6604 from chu11/kvs_refactor2
mergify[bot] Feb 7, 2025
44cd1f8
ci: ensure unit tests are run during coverage
grondo Feb 7, 2025
1197465
Merge pull request #6617 from grondo/fix-coverage
mergify[bot] Feb 7, 2025
e795bdf
etc: update bash completions
grondo Feb 7, 2025
ef29673
Merge pull request #6618 from grondo/fix-completions
mergify[bot] Feb 8, 2025
55cd1ce
kvs: update out of date comment
chu11 Feb 6, 2025
807718f
kvs: cleanup neglected functions
chu11 Feb 6, 2025
e935d17
kvs: use flux_msg_incref() over flux_msg_copy()
chu11 Feb 5, 2025
ea0cdbc
kvs: remove wait msg aux functions
chu11 Feb 6, 2025
f13e2e6
kvs: do not pass lookup handle to getroot()
chu11 Feb 6, 2025
a1b2c06
kvs: modernize cleanup saving of errno
chu11 Feb 6, 2025
c205af7
Merge pull request #6615 from chu11/kvs_cleanup3
mergify[bot] Feb 8, 2025
5550ee1
python: move EventLogEvent definition to flux.eventlog
grondo Feb 3, 2025
e81cb8c
python: add JournalConsumerBase abstract base class
grondo Feb 3, 2025
9016ab2
python: derive flux.job.JournalConsumer from JournalConsumerBase
grondo Feb 3, 2025
d359e7c
python: add class for consuming the resource module journal
grondo Feb 3, 2025
aa3f5ee
testsuite: add tests for Python ResourceJournalConsumer class
grondo Feb 5, 2025
026fc9e
python: add flux.eventlog.EventLogFormatter class
grondo Feb 5, 2025
f7a6251
testsuite: add EventLogFormatter tests
grondo Feb 6, 2025
b2d3695
cmd: add formatting, color options to `flux resource eventlog`
grondo Feb 5, 2025
c05db7a
testsuite: fix eventlog usage in t2355-resource-journal.t
grondo Feb 5, 2025
f171831
testsuite: expand testing in t2355-resource-journal.t
grondo Feb 7, 2025
852ac6d
cmd: use ResourceJournalConsumer in `flux resource eventlog`
grondo Feb 6, 2025
8e79bd4
doc: update documentation of `flux resource eventlog` options
grondo Feb 7, 2025
90ef568
etc: add `flux resource eventlog` to bash completions
grondo Feb 7, 2025
779a41d
Merge pull request #6614 from grondo/resource-journal-consumer
mergify[bot] Feb 8, 2025
eb9376c
kvs: remove out of date comments
chu11 Feb 5, 2025
df1c9b8
kvs: remove stats clearing
chu11 Feb 5, 2025
27f4390
Merge pull request #6611 from chu11/issue6607_kvs_stats_clear_remove
mergify[bot] Feb 10, 2025
86bc2ef
kvs/test: bail out on failed cache_create()
chu11 Feb 11, 2025
6557fcf
kvs/test: cleanup kvsroot convenience tests
chu11 Feb 11, 2025
96132e5
kvs/test: rename test functions to be more clear
chu11 Feb 11, 2025
5d57888
kvs/test: remove unused initialization code
chu11 Feb 11, 2025
e4abf96
test/kvs: pass counter as arg instead of global
chu11 Feb 11, 2025
d7cde09
kvs: preserve errno in kvsroot_destroy()
chu11 Feb 10, 2025
5318770
kvs: preserve errno in kvs_wait_version_destroy()
chu11 Feb 11, 2025
41df35c
kvs: use zhashx for transaction_requests
chu11 Feb 10, 2025
605b4c4
kvs: use zhashx for roothash
chu11 Feb 10, 2025
0b8a577
kvs-watch: use zhashx for namespaces hash
chu11 Feb 12, 2025
b7141c4
Merge pull request #6627 from chu11/kvs_cleanup4
mergify[bot] Feb 13, 2025
ad31159
broker: update systemd status during shutdown
garlick Feb 10, 2025
bf375ba
broker: log message when peer won't shut down
garlick Feb 11, 2025
dd63c87
testsuite: cover delayed shutdown
garlick Feb 11, 2025
576a8ac
broker: trace requests received during shutdown
garlick Feb 11, 2025
fc1413b
Merge pull request #6623 from garlick/issue#6621
mergify[bot] Feb 13, 2025
7ec1949
kvs: remove dropcache
chu11 Feb 5, 2025
8b76019
flux-kvs: remove dropcache command
chu11 Feb 11, 2025
4630b35
doc: remove flux kvs dropcache documentation
chu11 Feb 11, 2025
d7cf1c8
libkvs: remove flux_kvs_dropcache()
chu11 Feb 11, 2025
9e296cb
etc/completions: remove flux kvs dropcache
chu11 Feb 11, 2025
4b52519
python: remove kvs dropcache() function
chu11 Feb 11, 2025
be350d6
Merge pull request #6622 from chu11/issue6608_kvs_dropcache_remove
mergify[bot] Feb 13, 2025
a6470d5
kvs: move wait_version api into kvsroot
chu11 Feb 11, 2025
f581c8b
kvs: use zlistx_t for wait_version_list
chu11 Feb 11, 2025
e70e3c7
kvs: use zlistx_t for removelist
chu11 Feb 10, 2025
9029a38
Merge pull request #6628 from chu11/kvs_cleanup5
mergify[bot] Feb 13, 2025
24df7a5
testsuite: improve `flux resource eventlog -F` test
grondo Feb 13, 2025
4f19a0d
flux-resource: fix eventlog --follow
grondo Feb 13, 2025
04c71be
Merge pull request #6635 from grondo/issue#6634
mergify[bot] Feb 13, 2025
a3d8c35
resource: switch to a zlistx_t for resource journal
grondo Feb 12, 2025
aa009e2
resource: add configurable journal size limit
grondo Feb 12, 2025
429de17
resource: allow reconfigure of journal limit
grondo Feb 12, 2025
38de4e3
resource: truncate resource journal if configured
grondo Feb 12, 2025
d2bb51b
testsuite: add resource journal truncation testing
grondo Feb 13, 2025
6f79323
doc: document journal-max key in flux-config-resource(5)
grondo Feb 13, 2025
f6bef37
Merge pull request #6633 from grondo/reslog-truncate-simple
mergify[bot] Feb 14, 2025
b3aa43c
doc: expand job termination information in flux-config-exec(5)
grondo Feb 14, 2025
bc37f29
doc: add missing ref in flux-config-exec(5)
grondo Feb 14, 2025
934fcd8
Merge pull request #6640 from grondo/issue#6606
mergify[bot] Feb 14, 2025
5842b8e
libsubprocess: drop outdated comment
garlick Feb 14, 2025
bbbcf71
libsubprocess: drop bulk_exec_imp_kill() prototype
garlick Feb 14, 2025
ac5dd98
libsubprocess: adjust white space
garlick Feb 14, 2025
820dd72
Merge pull request #6642 from garlick/bulk_cleanup
mergify[bot] Feb 14, 2025
358e466
python: fix except_fields text handling in OutputFormat.copy()
grondo Feb 14, 2025
9baeef6
python: add option to nullify expansion sentinel in OutputFormat
grondo Feb 14, 2025
8df3a3d
python: fix incorrectly deduplicated lines in Deduplicator
grondo Feb 14, 2025
a9d127e
testsuite: python: add tests for OutputFormat.copy()
grondo Feb 14, 2025
e1c3af2
testsuite: add reproducer for issue #6625
grondo Feb 14, 2025
5e8c975
flux-resource: do not use `+` suffix with `+:` prefix in formats
grondo Feb 14, 2025
5c48b55
Merge pull request #6638 from grondo/issue#6625
mergify[bot] Feb 14, 2025
0887b61
flux-version: report hwloc.api=x.y.z instead of hwloc=x.y.z
grondo Feb 14, 2025
f7ab135
Merge pull request #6639 from grondo/issue#6637
mergify[bot] Feb 14, 2025
791cf56
doc: add job classifications to glossary
garlick Feb 14, 2025
3e01e0e
Merge pull request #6647 from garlick/glossary_update
mergify[bot] Feb 17, 2025
bbfdd3c
flux-job: fix potential duplicate output in `flux job attach`
grondo Feb 15, 2025
1f6b990
Merge pull request #6649 from grondo/issue#6648
mergify[bot] Feb 17, 2025
6d607af
python: do not force ascii output in EventLogFormatter
grondo Feb 17, 2025
c8c0052
testsuite: test non-ascii output in EventLogFormatter tests
grondo Feb 17, 2025
e2e8f37
Merge pull request #6650 from grondo/eventlog-utf8
mergify[bot] Feb 18, 2025
1ce3fd0
t: add flux jobs user filter tests
chu11 Feb 14, 2025
c40695a
flux-jobs: filter against all users with --include
chu11 Feb 13, 2025
c4e88c7
doc: note --include implies -A in flux-jobs(1)
chu11 Feb 13, 2025
4067757
t: cover flux-jobs --include filtering
chu11 Feb 14, 2025
9f2de10
Merge pull request #6646 from chu11/issue6585_flux_jobs_include
mergify[bot] Feb 18, 2025
86c2674
resource: allow optional reason with undrain RPC
grondo Feb 14, 2025
456d55b
flux-resource: support reason with undrain
grondo Feb 15, 2025
beeb017
doc: document undrain reason in flux-resource(1)
grondo Feb 15, 2025
10f78b8
testsuite: test undrain reason
grondo Feb 15, 2025
6c0f924
flux-resource: add `-i, --include=TARGETS` to eventlog command
grondo Feb 22, 2025
84f0275
doc: document `flux resource eventlog --include`
grondo Feb 22, 2025
b43cadc
testsuite: test `flux resource eventlog -i, --include`
grondo Feb 23, 2025
ad542d3
Merge pull request #6659 from grondo/issue#6599
mergify[bot] Feb 23, 2025
53d4f0d
librlist: make idset argument const in rlist_remove_ranks()
grondo Feb 18, 2025
0e29fcf
librlist: add rlist_free_tolerant()
grondo Feb 18, 2025
701aac7
librlist: add tests for rlist_free_tolerant()
grondo Feb 18, 2025
f4a6ca0
sched-simple: support RFC 28 `shrink` key
grondo Feb 18, 2025
6bd5bd7
sched-simple: tolerate missing ranks in free
grondo Feb 18, 2025
4490b99
resource: monitor lost ranks
grondo Feb 19, 2025
427db5f
resource: shrink down ranks unless method=configuration
grondo Feb 18, 2025
2e353e5
resource: ensure sched-status response excludes removed resources
grondo Feb 18, 2025
2f17b18
resource: add resource.monitor-force-down RPC
grondo Feb 21, 2025
01b5d49
testsuite: test resource acquisition protocol `shrink` support
grondo Feb 21, 2025
fd30f98
Merge pull request #6652 from grondo/shrunk
mergify[bot] Feb 24, 2025
87f6870
broker: fix white space issue
garlick Feb 24, 2025
7a905e0
broker: rename broker.quorum-warn
garlick Feb 24, 2025
58a618f
broker: rename broker.shutdown-warn
garlick Feb 24, 2025
381bd09
Merge pull request #6660 from garlick/rename_attrs
mergify[bot] Feb 24, 2025
2d239e5
testsuite: fix flaky test for handling of invalid `tbon.topo`
wihobbs Feb 21, 2025
9762f63
Merge pull request #6657 from wihobbs/issue-6655
mergify[bot] Feb 25, 2025
6634d85
deb: require libsystemd-dev
garlick Feb 23, 2025
05e42db
broker: fix conditional sd_notify()
garlick Feb 23, 2025
008f13a
broker: extend timeouts for systemctl stop flux
garlick Feb 24, 2025
d602081
broker: use common sd_notify() interface
garlick Feb 24, 2025
79fcdc2
broker: add state-machine.sd-notify
garlick Feb 24, 2025
0b0cf78
flux-dump: use state-machine.sd-notify
garlick Feb 24, 2025
39dd8e2
flux-restore: use state-machine.sd-notify
garlick Feb 24, 2025
3209075
flux-dump: add --sd-notify option
garlick Feb 24, 2025
560d69d
flux-restore: add --sd-notify option
garlick Feb 24, 2025
f797ca5
flux-restore: avoid duplicate notifications
garlick Feb 24, 2025
1892c40
flux-dump: avoid duplicate notifications
garlick Feb 24, 2025
2d1a7f6
flux-broker-attributes(7): add missing attrs
garlick Feb 24, 2025
7b98c0e
systemd: set NotifyAccess=main
garlick Feb 25, 2025
a03a7c1
broker: add NOTIFY_SOCKET to runat blocklist
garlick Feb 25, 2025
982d7ac
libsubprocess: make server env handling readable
garlick Feb 25, 2025
dd1efac
libsubprocess: don't leak NOTIFY_SOCKET into env
garlick Feb 25, 2025
7a8b91d
sdexec: don't leak NOTIFY_SOCKET into env
garlick Feb 25, 2025
4b0a520
Merge pull request #6661 from garlick/stop_timeout
mergify[bot] Feb 25, 2025
ddbb39b
libsubprocess: fix error path bug
garlick Feb 25, 2025
da5eb7c
Merge pull request #6663 from garlick/oops
mergify[bot] Feb 25, 2025
513ba0c
gitignore: ignore PLY autogenerated parsetab.py
sam-maloney Feb 24, 2025
f0eb393
Merge pull request #6664 from sam-maloney/gitignore-parsetab
mergify[bot] Feb 26, 2025
41e07d7
libsdexec: parse TimeoutStopUSec property
garlick Feb 26, 2025
8eb4b4e
testsuite: test TimeoutStopUSec property
garlick Feb 26, 2025
4dc6fc2
libsdexec: rework Type property handling
garlick Feb 26, 2025
34233f3
testsuite: test Type property
garlick Feb 26, 2025
4cea52f
sdexec: add a mechanism to time out units
garlick Feb 25, 2025
058387d
job-exec: use Type=notify and timer with sdexec
garlick Feb 26, 2025
a7b550d
flux-config-exec(5): add sdexec-stop-timer stuff
garlick Feb 26, 2025
6ef0d5b
job-exec: drain nodes with unkillable processes
garlick Feb 27, 2025
af9115a
configure: require flux-security >= 0.14.0
garlick Feb 27, 2025
120ed73
deb: require flux-security >= 0.14.0
garlick Feb 27, 2025
a84adc0
ci: bump default flux-security version
garlick Feb 27, 2025
26e39f2
Merge pull request #6666 from garlick/sdexec_notify
mergify[bot] Feb 28, 2025
fce96cd
perilog: abstract exception message generation
grondo Feb 27, 2025
a767a83
perilog: raise non-fatal job exception on epilog failure
grondo Feb 27, 2025
513cc87
testsuite: ensure epilog failure logs job exception
grondo Feb 27, 2025
c57d3b1
Merge pull request #6669 from grondo/issue#6349
mergify[bot] Feb 28, 2025
63d5c4d
flux-hostlist: add `-F, --find=HOSTS` option
grondo Feb 28, 2025
454df2a
testsuite: add tests for `flux hostlist -F, --find`
grondo Feb 28, 2025
520eae5
doc: document `-F, --find` option in flux-hostlist(1)
grondo Feb 28, 2025
f15140e
Merge pull request #6671 from grondo/hostlist-find
mergify[bot] Feb 28, 2025
3f719d9
sharness: add test_flux_security_version()
grondo Feb 28, 2025
8487447
sdexec: abort module if flux-security < v0.14.0
grondo Feb 28, 2025
4646b51
testsuite: require flux-security v0.14.0 where needed
grondo Feb 28, 2025
8d61172
configure: relax flux-security version check
grondo Feb 28, 2025
ff486ca
Merge pull request #6673 from grondo/downgrade-flux-security
mergify[bot] Mar 1, 2025
7a25679
sdexec: fix comment grammar
garlick Feb 3, 2025
09587c9
sdbus: clean up error handling
garlick Feb 3, 2025
9326af6
sdbus: add system module option
garlick Feb 3, 2025
88c93a8
testsuite: cover sdbus system option
garlick Feb 3, 2025
9e3c741
sdbus: allow module to be loaded under any name
garlick Feb 3, 2025
47a22f4
testsuite: cover sdbus-sys
garlick Feb 3, 2025
7e98ecd
rc: load sdbus-sys
garlick Feb 3, 2025
b8bf112
libsdexec: add service name to some RPC functions
garlick Feb 3, 2025
a7ac6a8
sdmon: add new systemd monitor module
garlick Feb 3, 2025
4c50d8e
rc: conditionally load sdmon module
garlick Feb 3, 2025
df1741a
resource: parse systemd.enable
garlick Feb 6, 2025
c614eb3
resource: conditionally monitor sdmon.online
garlick Feb 6, 2025
27977ac
testsuite: add sdmon test script
garlick Feb 7, 2025
6b86e5f
testsuite: cover resource with sdmon.online
garlick Feb 7, 2025
5ee36b4
Merge pull request #6616 from garlick/issue#6590
mergify[bot] Mar 1, 2025
3d0d8bd
perilog: fix typo in return statement
grondo Feb 27, 2025
1e097d1
perilog: Add FLUX_JOB_RANKS to environment of prolog/epilog
grondo Feb 27, 2025
dcafc5c
testsuite: test FLUX_JOB_RANKS availability in job prolog
grondo Feb 27, 2025
b8001f0
doc: document FLUX_JOB_RANKS in flux-environment(7)
grondo Feb 27, 2025
7c6746e
Merge pull request #6670 from grondo/perilog-ranks
mergify[bot] Mar 2, 2025
e9da7df
perilog: update outdated comment
grondo Mar 1, 2025
15fdbf1
perilog: start timeout timer when launching procesess
grondo Mar 1, 2025
352439f
perilog: allow kill-timeout to be set for epilog
grondo Mar 1, 2025
13f4f73
doc: improve prolog/epilog documentation
grondo Mar 1, 2025
621c7b8
Merge pull request #6677 from grondo/issue#6644
mergify[bot] Mar 4, 2025
f430e58
t: test cli handling of double declared shell option
wihobbs Mar 3, 2025
5acc90d
improve error message on invalid formatting of shell options
wihobbs Mar 3, 2025
50dcd44
Merge pull request #6680 from wihobbs/issue-6678
mergify[bot] Mar 4, 2025
e7c5f38
flux-queue: do not default to --all with configured queues
grondo Mar 3, 2025
79dd652
Merge pull request #6681 from grondo/issue#6674
mergify[bot] Mar 4, 2025
9f49c07
resource: ignore torpid/lively events in lost rank detection
grondo Mar 1, 2025
04c1e44
testsuite: ensure torpid/lively events do not affect shrink behavior
grondo Mar 1, 2025
c0b559b
Merge pull request #6676 from grondo/issue#6675
mergify[bot] Mar 4, 2025
d36d542
cleanup: fix issues found by new typos version
grondo Mar 4, 2025
c9fcec4
github: update spelling action
grondo Mar 4, 2025
6b7aa59
Merge pull request #6683 from grondo/ci-ubuntu-update
mergify[bot] Mar 4, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions config/x_ac_jansson.m4
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ AC_DEFUN([X_AC_JANSSON], [
AC_MSG_ERROR([flux cannot be built on a system with 16 bit ints])
])

AC_REPLACE_FUNCS(json_object_update_recursive)

LIBS="$ac_save_LIBS"
CFLAGS="$ac_save_CFLAGS"
]
Expand Down
5 changes: 4 additions & 1 deletion src/common/libflux/conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
#include <glob.h>
#include <jansson.h>
#include <flux/core.h>
#if !HAVE_JSON_OBJECT_UPDATE_RECURSIVE
#include "src/common/libmissing/json_object_update_recursive.h"
#endif

#include "src/common/libutil/intree.h"
#include "src/common/libutil/errno_safe.h"
Expand Down Expand Up @@ -234,7 +237,7 @@ static int conf_update_obj (flux_conf_t *conf,
json_t *obj,
flux_error_t *error)
{
if (json_object_update (conf->obj, obj) < 0) {
if (json_object_update_recursive (conf->obj, obj) < 0) {
errprintf (error,
"%s: updating JSON object: out of memory",
filename);
Expand Down
19 changes: 19 additions & 0 deletions src/common/libflux/test/conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ const char *tab3 = \
const char *tab3_json = \
"{\"tab3\": {\"id\": 4}}";

const char *tab4 = \
"[tab]\n" \
"added = \"bar\"";


static void
create_test_file (const char *dir,
Expand Down Expand Up @@ -109,6 +113,7 @@ void test_basic (void)
char path1[PATH_MAX + 1];
char path2[PATH_MAX + 1];
char path3[PATH_MAX + 1];
char path4[PATH_MAX + 1];
char pathj[PATH_MAX + 1];
char invalid[PATH_MAX + 1];
flux_error_t error;
Expand Down Expand Up @@ -136,6 +141,7 @@ void test_basic (void)
create_test_file (dir, "01", "toml", path1, sizeof (path1), t1);
create_test_file (dir, "02", "toml", path2, sizeof (path2), tab2);
create_test_file (dir, "03", "toml", path3, sizeof (path3), tab3);
create_test_file (dir, "04", "toml", path4, sizeof (path4), tab4);
create_test_file (NULL, "03", "json", pathj, sizeof (pathj), tab3_json);

/* Parse of one file works
Expand Down Expand Up @@ -242,6 +248,18 @@ void test_basic (void)
ok (rc == 0 && i == 42,
"unpacked integer from [tab] and got expected value");

/* Check that tab was updated with added value from tab4
*/
rc = flux_conf_unpack (conf,
&error,
"{s:{s:s}}",
"tab",
"added", &s);
diag ("added = %s", s);
ok (rc == 0 && streq (s, "bar"),
"unpacked added string from [tab] and got expected value");


/* Check table from second toml file
*/
i = 0;
Expand Down Expand Up @@ -331,6 +349,7 @@ void test_basic (void)
if ( (unlink (path1) < 0)
|| (unlink (path2) < 0)
|| (unlink (path3) < 0)
|| (unlink (path4) < 0)
|| (unlink (pathj) < 0)
|| (unlink (invalid) < 0) )
BAIL_OUT ("unlink: %s", strerror (errno));
Expand Down
3 changes: 2 additions & 1 deletion src/common/libmissing/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,5 @@ EXTRA_libmissing_la_SOURCES = \
envz.h \
envz.c \
macros.h \
strerrorname_np.h
strerrorname_np.h \
json_object_update_recursive.h
32 changes: 32 additions & 0 deletions src/common/libmissing/json_object_update_recursive.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright (c) 2009-2016 Petri Lehtinen <[email protected]>
*
* Jansson is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See LICENSE for details.
*/

#include <jansson.h>

/* Taken from jansson v2.13 source. This version does not do a loop
* check as is done in later versions of this function. The loop check
* requires access to jansson internals.
*/
int json_object_update_recursive (json_t *object, json_t *other)
{
const char *key;
json_t *value;

if (!json_is_object (object) || !json_is_object (other))
return -1;

json_object_foreach (other, key, value) {
json_t *v = json_object_get (object, key);

if (json_is_object (v) && json_is_object (value))
json_object_update_recursive (v, value);
else
json_object_set_nocheck (object, key, value);
}

return 0;
}
24 changes: 24 additions & 0 deletions src/common/libmissing/json_object_update_recursive.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/************************************************************\
* Copyright 2024 Lawrence Livermore National Security, LLC
* (c.f. AUTHORS, NOTICE.LLNS, COPYING)
*
* This file is part of the Flux resource manager framework.
* For details, see https://github.com/flux-framework.
*
* SPDX-License-Identifier: LGPL-3.0
\************************************************************/

#ifndef LIBMISSING_JANNSON_UPDATE_RECURSIVE_H
#define LIBMISSING_JANNSON_UPDATE_RECURSIVE_H 1

/* Like json_object_update(), but object values in *other* are
* recursively merged the corresponding values in *object* if they
* are also objects, instead of overwriting them. Returns a 0 on
* successs or -1 on error.
*
* Note: This version doesn't detect cycles like the version found
* in jansson >= 2.13.1.
*/
int json_object_update_recursive (json_t *object, json_t *other);

#endif