- use SO_REUSEPORT_LB if available (FreeBSD 12.0+)
- lua: remove dependency on lua-socket and lua-sec, used lua-http and cqueues (#512, #521, !894)
- net.listen(): allow binding to non-local address with freebind option (!898)
+- cache: pre-allocate the file to avoid SIGBUS later (not macOS; !917, #525)
Knot Resolver 4.3.0 (2019-12-04)
return lmdb_error(ret);
}
+#if !defined(__MACOSX__) && !(defined(__APPLE__) && defined(__MACH__))
+ auto_free char *mdb_datafile = kr_strcatdup(2, path, "/data.mdb");
+ int fd = open(mdb_datafile, O_RDWR);
+ if (fd == -1) {
+ mdb_txn_abort(txn);
+ stats->close++;
+ mdb_env_close(env->env);
+ return kr_error(errno);
+ }
+
+ ret = posix_fallocate(fd, 0, mapsize);
+ if (ret != 0) {
+ mdb_txn_abort(txn);
+ stats->close++;
+ mdb_env_close(env->env);
+ close(fd);
+ return kr_error(ret);
+ }
+ close(fd);
+#endif
+
stats->commit++;
ret = mdb_txn_commit(txn);
if (ret != MDB_SUCCESS) {