diff --git a/doc/sphinx/book/connectors/__c.rst b/doc/sphinx/book/connectors/__c.rst index 6bf76130dd49429268960260dc0b129882ad2a51..9a592aa03ad916ee48396f61eda499133463835e 100644 --- a/doc/sphinx/book/connectors/__c.rst +++ b/doc/sphinx/book/connectors/__c.rst @@ -2,6 +2,8 @@ C ===================================================================== +:c:func:`tarantoolc:tnt_connect` + Here follow two examples of using Tarantool's high-level C API. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -15,7 +17,7 @@ space :code:`examples` via the high-level C API. #include <stdio.h> #include <stdlib.h> - + #include <tarantool/tarantool.h> #include <tarantool/tnt_net.h> #include <tarantool/tnt_opt.h> @@ -149,7 +151,7 @@ requests in the box library. In this program, the choice is to do an INSERT request, so the program passes the ``tnt_stream`` that was used for connection -(:code:`tnt`) and the stream that was set up with :func:`tnt_object_format` +(:code:`tnt`) and the stream that was set up with :c:func:`tarantoolc:tnt_object_format` (:code:`tuple`). Function description: @@ -187,7 +189,7 @@ Function description: void tnt_reply_free(struct tnt_reply \*r) **TEARDOWN:** When a session ends, the connection that was made with -:func:`tnt_connect()` should be closed, and the objects that were made in the setup +:c:func:`tarantoolc:tnt_connect()` should be closed, and the objects that were made in the setup should be destroyed. .. code-block:: c diff --git a/doc/sphinx/conf.py b/doc/sphinx/conf.py index 89ba70711d22e8bd0060fa70a8a0b4bfc021e33b..eabd0ece9b483556537a5f1b4e273affd7aff598 100644 --- a/doc/sphinx/conf.py +++ b/doc/sphinx/conf.py @@ -18,7 +18,8 @@ extensions = [ 'ext.LuaLexer', 'ext.TapLexer', 'ext.TarantoolSessionLexer', - 'breathe' + 'breathe', + 'sphinx.ext.intersphinx', ] primary_domain = 'lua' templates_path = ['../_templates'] @@ -83,13 +84,13 @@ rst_prolog = """ .. role:: codebolditalic :class: ccodebi - + .. role:: codegreen :class: ccodegreen - + .. role:: codered :class: ccodered - + .. role:: codeblue :class: ccodeblue @@ -103,11 +104,8 @@ rst_epilog = """ <br /> """ -# def setup(sphinx): -# sys.path.insert(0, os.path.abspath('./ext')) -# from LuaLexer import LuaLexer -# sphinx.add_lexer("lua_tarantool", LuaLexer()) -# from TarantoolSessionLexer import TarantoolSessionLexer -# sphinx.add_lexer("tarantoolsession", TarantoolSessionLexer()) -# from TapLexer import TAPLexer -# sphinx.add_lexer('tap', TAPLexer()) +intersphinx_mapping = { + 'tarantoolc': ('http://tarantool.github.io/tarantool-c/', None) +} + +intersphinx_cache_limit = 0 diff --git a/doc/www/content/newsite/index_308.yml b/doc/www/content/newsite/index_200.yml similarity index 99% rename from doc/www/content/newsite/index_308.yml rename to doc/www/content/newsite/index_200.yml index abfc8424a7807fce464c063c5eba8b891551f22d..2a4fb3849a7d65682ff4a00ca0889788af6cf25a 100644 --- a/doc/www/content/newsite/index_308.yml +++ b/doc/www/content/newsite/index_200.yml @@ -1,8 +1,8 @@ --- title : "Tarantool - A NoSQL database running in a Lua application server" -slug : "index_308" -save_as : "index_308.html" -template: "index_308" +slug : "index_200" +save_as : "index_200.html" +template: "index_200" blocks : header: - "Tarantool" diff --git a/doc/www/theme/templates/index_308.html b/doc/www/theme/templates/index_200.html similarity index 100% rename from doc/www/theme/templates/index_308.html rename to doc/www/theme/templates/index_200.html diff --git a/extra/dist/tarantoolctl.in b/extra/dist/tarantoolctl.in index 7b1a06d9307524360a0d70232d83b0915a6028f7..db74405690880524475d63f3e3475d8f86e53c17 100755 --- a/extra/dist/tarantoolctl.in +++ b/extra/dist/tarantoolctl.in @@ -150,8 +150,8 @@ local group_name -- -- overrides for defaults files -- --- local instance_dir --- local default_cfg +local instance_dir +local default_cfg -- -- print usage and exit @@ -240,17 +240,24 @@ end -- -- System-wide default file may be missing, this is OK, we'll assume built-in -- defaults +-- It uses sandboxing for isolation. It's not completely safe, but it won't +-- allow a pollution of global variables -- local function load_default_file(default_file) if default_file then - local success, data = pcall(dofile, default_file) + local env = setmetatable({}, { __index = _G }) + local ufunc, msg = loadfile(default_file) -- if load fails - show last 10 lines of the log file - if not success then - log.error("Failed to load defaults file: %s", data) - if fio.stat(default_cfg.logger) then - os.execute('tail -n 10 ' .. default_cfg.logger) - end + if not ufunc then + log.error("Failed to load defaults file: %s", msg) end + debug.setfenv(ufunc, env) + local state, msg = pcall(ufunc) + if not state then + log.error('Failed to execute defaults file: %s', msg) + end + default_cfg = env.default_cfg + instance_dir = env.instance_dir end local d = default_cfg or {} diff --git a/extra/travis/build_osx.sh b/extra/travis/build_osx.sh index 217cb7e9281a65fb9733a7a36cba9894487def4c..7ecc2b81d64c5e00c2e80400ed842095cb12730d 100755 --- a/extra/travis/build_osx.sh +++ b/extra/travis/build_osx.sh @@ -1,3 +1,4 @@ +brew install openssl sudo pip install python-daemon PyYAML sudo pip install six==1.9.0 sudo pip install gevent diff --git a/src/box/lua/snapshot_daemon.lua b/src/box/lua/snapshot_daemon.lua index b0cd1725b58bbaa18d9cd7b69d8ac2e085f2a594..f41226e655e664291654f4fce89de581d019edbf 100644 --- a/src/box/lua/snapshot_daemon.lua +++ b/src/box/lua/snapshot_daemon.lua @@ -172,29 +172,29 @@ do if interval == nil then break end - if self.control:get(interval) == nil then + fiber.sleep(interval) + if self.reloaded ~= true then local s, e = pcall(process, self) if not s then log.error(e) end else + self.reloaded = false log.info("reloaded") end end log.info("stopped") - self.control:close() - self.control = nil self.fiber = nil end local function reload(self) if self.snapshot_period > 0 and self.fiber == nil then - self.control = fiber.channel(5) self.fiber = fiber.create(daemon_fiber, self) elseif self.fiber ~= nil then -- wake up daemon - self.control:put(true) + self.reloaded = true + fiber.wakeup(self.fiber) end end