mapcache
mapcache copied to clipboard
Add child init hook for cache backends
Depending on a cache backend in use it might be necessary to perform some kind of initialization when a server worker process starts. In the case of Apache (MPM event) the child_init hook runs after a process has been created (forked) and before serving threads have been created. Currently this child_init hook is not exposed directly to cache backends and it is used only to set up connection pool. This PR adds a child_init hook for usage in any cache backend. At the moment there are no backends using this hook, although it might be required for (probably) Berkeley and (quite certainly) for TokyoCabinet backends. A LMDB cache backend requiring this hook is now under testing.
OK with this patch in principle. Could you remove the changed lines where only whitespace formatting has been changed please. Also, given that very few caches actually use this, can you create a single no-op mapcache_cache_null_child_init function and reference that one instead of creating one no-op child init function per cache. thanks!
It is a bit pity that the astyle script present in the code base can not be run after making modifications to files.
I replaced all cache specific child init functions with a single noop function. Should be better now.
I do not understand why tests are failing as (at least locally) I see that images are generated and seem to be fine although their checksums do not match one listed in the test script. A difference in GDAL/libjpeg?
I think Travis CI check should be unplugged now: A GitHub Actions check has been activated few months ago. I just don't understand why it has not been triggered here.
Is there anything I can do to push this forward? #293 can not be merged before this PR.
fwiw, 1.14 fails to build with clang 13 on OpenBSD:
In file included from /usr/obj/ports/mapcache-1.14.0/mapcache-1.14.0/lib/axisorder.c:30:
/usr/obj/ports/mapcache-1.14.0/mapcache-1.14.0/include/mapcache.h:389:8: error: unknown type name 'inline'
static inline void mapcache_cache_child_init_noop(mapcache_context *ctx, mapcache_cache *cache, apr_pool_t *pchild) {
dropping the inline
makes clang warn about unused function 'mapcache_cache_child_init_noop'
but at least the build succeeds.
fwiw, apparently inline
fails because of forcing -std=c89
fwiw, apparently
inline
fails because of forcing-std=c89
This doesn't seem to be right as there is no such limitation for GCC.
i have no idea whether this is right or wrong, i'm just saying it fails with clang 13 in this configuration.