Skip to content
Snippets Groups Projects
  1. Apr 23, 2024
    • Georgiy Lebedev's avatar
      netbox: close transport after stopping worker loop and wait for the stop · c4c022e2
      Georgiy Lebedev authored
      
      Currently, we close the transport from transport from
      `luaT_netbox_transport_stop`, and we do not wait for the worker fiber to
      stop. This causes several problems.
      
      Firstly, the worker can switch context by yielding (`coio_wait`) or
      entering the Lua VM (`netbox_on_state_change`). During a context switch,
      the connection can get closed. When the connection is closed, its receive
      buffer is reset. If there was some pending response that was partially
      retrieved (e.g., a large select), then after resetting the buffer we will
      read some inconsistent data. We must not allow this to happen, so let's
      check for this case after returning from places where the worker can switch
      context. In between closing the connection and cancelling the connection's
      worker, an `on_disconnect` trigger can be called, which, in turn, can
      also yield, returning control to the worker before it gets cancelled.
      
      Secondly, when the worker enters the Lua VM, garbage collection can be
      triggered and the connection owning the worker could get closed
      unexpectedly to the worker.
      
      The fundamental source of these problems is that we close the transport
      before the worker's loop stops. Instead, we should close it after the
      worker's loop stops. In `luaT_netbox_transport_stop`, we should only cancel
      the worker, and either wait for the worker to stop, if we are not executing
      on it, or otherwise throw an exception (`luaL_testcancel`) to stop the
      worker's loop. The user will still have the opportunity to catch this
      exception and prevent stoppage of the worker at his own risk. To safeguard
      from this scenario, we will now keep the `is_closing` flag enabled once
      `luaT_netbox_transport_stop` is called and never disable it.
      
      There also still remains a special case of the connection getting garbage
      collected, when it is impossible to stop the worker's loop, since we cannot
      join the worker (yielding is forbidden from finalizers), and an exception
      will not go past the finalizer. However, this case is safe, since the
      connection is not going to be used by this point, so the worker can simply
      stop on its own at some point. The only thing we need to account for is
      that we cannot wait for the worker to stop: we can reuse the `wait` option
      of `luaT_netbox_transport_stop` for this.
      
      Closes #9621
      Closes #9826
      
      NO_DOC=<bugfix>
      
      Co-authored-by: default avatarVladimir Davydov <vdavydov@tarantool.org>
      (cherry picked from commit fcf7f5c4)
      
      Cherry pick note: Dropped gh_9621_netbox_worker_crash_test because
      box.iproto.encode helpers aren't available on 2.11.
      c4c022e2
  2. Apr 19, 2024
  3. Apr 17, 2024
  4. Apr 16, 2024
    • Aleksandr Lyapunov's avatar
      memtx: fix a bug with mvcc and exclude_null option · 364af9bf
      Aleksandr Lyapunov authored
      Before this patch MVCC engine expected that if index_replace
      sets `result` to NULL then index_replace sets `successor` to
      something (NULL or existing tuple, depending on index type).
      That looked fine because by contract `successor` is set when
      true insertion was happened.
      
      Unfortunately it was not considered that in case of part with
      `exclude_null` option in index the insertion can be silently
      skipped and thus `successor` can be not set. The latter access
      of it was actually an UB.
      
      Fix it by explicit check of tuple_key_is_excluded and work on
      this case correctly.
      
      Note that logically `index_replace` should return a flag whether
      the new tuple was filtered (excluded) by key_def. But on the other
      hand this flag is required only for mvcc while the function is
      already has lots of arguments and it's very cheap to determine
      this flag right from memtx_tx, so I decided to make the most
      simple patch.
      
      NO_DOC=bugfix
      
      (cherry picked from commit 14e21297)
      364af9bf
  5. Apr 15, 2024
    • Alexander Turenko's avatar
      build: use VK S3 for icu4c and zziplib archives · fea7777d
      Alexander Turenko authored
      The CI/CD builds are performed on VK Cloud virtual machines, so the
      access to VK S3 is more reliable than to GitHub archives.
      
      In fact, we experience periodical download problems with source archives
      on GitHub in Tarantool Enterprise Edition builds in CI/CD and it is the
      motivation to backup the archives on our side. The problems appear quite
      frequently last few days.
      
      The download problems are not on VK Cloud side and not on GitHub side.
      The packet loss is somewhere in the middle. I don't know an exact reason
      for now.
      
      NO_DOC=no user-visible changes
      NO_CHANGELOG=see NO_DOC
      NO_TEST=see NO_DOC
      
      (cherry picked from commit 03445e6b)
      fea7777d
  6. Apr 12, 2024
  7. Apr 11, 2024
    • Sergey Kaplun's avatar
      luajit: bump new version · 30bc98a5
      Sergey Kaplun authored
      * ci: bump version of actions/checkout
      * test: fix typo in the link to the issue
      * test: refactor CMake macro LibRealPath
      * test: move LibRealPath to the separate module
      * test: more cautious usage of LD_PRELOAD for ASan
      * test: fix lj-802-panic-at-mcode-protfail GCC+ASan
      * ci: execute LuaJIT tests with GCC 10 and ASAN
      * cmake: replace prove with CTest
      * Prevent down-recursion for side traces.
      * Handle stack reallocation in debug.setmetatable() and
        lua_setmetatable().
      * profilers: print user-friendly errors
      
      Closes #5994
      Closes #9595
      Closes #9217
      Closes #9656
      
      NO_DOC=LuaJIT submodule bump
      NO_TEST=LuaJIT submodule bump
      30bc98a5
  8. Apr 05, 2024
  9. Apr 03, 2024
  10. Mar 29, 2024
    • Yaroslav Lobankov's avatar
      codeowners: drop devx team review for tests · 2154a7f3
      Yaroslav Lobankov authored
      It has been decided to drop required devx team review for tests.
      
      NO_DOC=codeowners
      NO_TEST=codeowners
      NO_CHANGELOG=codeowners
      
      (cherry picked from commit 58f5ffe4)
      2154a7f3
    • Andrey Saranchin's avatar
      build: include header "unit.h" after c++ headers · c014944e
      Andrey Saranchin authored
      Header "unit.h" contains `ok` and `is` macros used to check test cases.
      The problem is such simple names can be used in C++ STL library headers
      (it's OK because such short names can be hidden in a namespace), so when
      including, for example, header "vector" after "unit.h", build can fail
      because function declaration or definition in the C++ header will turn
      into a macro invocation. I faced this problem building Tarantool on
      MacOS with SDK of 14.4 version.
      
      NO_TEST=fix build
      NO_CHANGELOG=fix build
      NO_DOC=fix build
      
      (cherry picked from commit 025ba32f)
      c014944e
  11. Mar 28, 2024
    • Andrey Saranchin's avatar
      box: support exclude_null option in functional indexes · d41901a0
      Andrey Saranchin authored
      Currently, exclude_null option doesn't affect functional indexes at all.
      It seems that we just forgot to check if tuple should be inserted to the
      index - the patch simply adds missing check in replace and build_next
      methods of functional memtx_tree index.
      
      Closes #9732
      
      NO_DOC=bugfix
      
      (cherry picked from commit c56998fa)
      d41901a0
    • Georgiy Lebedev's avatar
      net.box: reference the connection object from asynchronous requests · 3e86dc91
      Georgiy Lebedev authored
      In order to prevent the garbage collection of the discarded connection,
      asynchronous requests must reference the connection object. We must
      reference the connection object rather than the transport object, because
      our garbage collection hook is attached to the former.
      
      Closes #9629
      
      NO_DOC=<bugfix>
      
      (cherry picked from commit fb5bf51c)
      3e86dc91
  12. Mar 26, 2024
    • Maxim Kokryashkin's avatar
      build: add CMake configuration for evread module · 8aad9687
      Maxim Kokryashkin authored
      This patch adds necessary cmake configurations for the
      <evread.lua> module, so it can be used later to implement
      human-readable error reporting in profile parsers.
      
      Part of #9217
      
      NO_DOC=LuaJIT submodule
      NO_TEST=covered by the LuaJIT tests
      NO_CHANGELOG=build
      
      (cherry picked from commit e01fe8f7)
      8aad9687
    • Alexander Turenko's avatar
      test: increase process termination waiting timeout · fe4a9e24
      Alexander Turenko authored
      This commit increases a time to wait of the process termination. It may
      take longer than 5 seconds, when tarantool is built with an address
      sanitizer. The address sanitizer generates a report at the process
      termination and it is not always a fast thing.
      
      NO_DOC=test fix
      NO_CHANGELOG=see NO_DOC
      
      (cherry picked from commit 5260bc2a)
      fe4a9e24
    • Mergen Imeev's avatar
      sql: decrease number of tests in in2.test.lua · 232d4474
      Mergen Imeev authored
      This patch reduces the number of tests in the in2.test.lua test file.
      This patch also reduces the number of inserted values. This shouldn't
      affect the test since it's not really an original Tarantool test, but it
      will reduce the execution time of this test. Currently this test often
      fails due to a timeout.
      
      NO_DOC=test
      NO_CHANGELOG=test
      
      (cherry picked from commit 0ae908cd)
      232d4474
  13. Mar 20, 2024
    • Sergey Kaplun's avatar
      luajit: bump new version · d7c04048
      Sergey Kaplun authored
      * test: set dependencies in BuildTestCLib macro
      * Add 'cc' file type for saving bytecode.
      * Fix C file generation in jit.bcsave.
      * Throw any errors before stack changes in trace stitching.
      * Fix recording of __concat metamethod.
      * Check frame size limit before returning to a lower frame.
      * build: purge sysprof.collapse module
      * build: fix tool components handling
      * memprof: refactor `heap_chunk` data structure
      * memprof: remove unused arguments
      * memprof: introduce the `--human-readable` option
      * profilers: introduce event reader module
      * ci: extend tarantool integration testing
      
      Part of #9595
      Part of #5994
      Follows up #8700
      Needed for #9217
      
      NO_DOC=LuaJIT submodule bump
      NO_TEST=LuaJIT submodule bump
      d7c04048
    • Maxim Kokryashkin's avatar
      ci: remove Tarantool tests from LuaJIT integration · b51e9b7c
      Maxim Kokryashkin authored
      After the commit 13ac5daf ("ci: fix step parameters for
      reusable runs") it is now possible to create Tarantool
      integration workflows for any repository in the Tarantool
      organization. Considering this, we don't need to run Tarantool
      tests under the old target for the LuaJIT integration in
      .test.mk and we can leave only LuaJIT tests in this target for
      the sake of exotic Tarantool builds testing.
      
      NO_DOC=CI
      NO_TEST=CI
      NO_CHANGELOG=CI
      b51e9b7c
  14. Mar 19, 2024
    • Georgiy Lebedev's avatar
      net.box: do not start worker fiber synchronously · d212b0bd
      Georgiy Lebedev authored
      Due to a regression introduced in c13b3a31, the worker fiber is started
      synchronously, while it should be started asynchronously, in order for the
      `wait_connected = false` option of `connect` to work correctly. We already
      explicitly wait from Lua for the connection to become active via
      `wait_state` when `wait_connected = true`.
      
      Closes #9489
      
      NO_DOC=<bugfix>
      
      (cherry picked from commit 0502a1f5)
      d212b0bd
    • Astronomax's avatar
      relay: fix stack use after return · cdb6a43d
      Astronomax authored
      Fixed a bug when it was possible that the `on_relay_thread_start`
      trigger handler would continue to use `data` allocated on the stack
      of `box_collect_confirmed_vclock` after returning from it.
      
      Closes #9505
      
      NO_DOC=bugfix
      NO_TEST=asan
      
      (cherry picked from commit 40bd0eb1)
      cdb6a43d
  15. Mar 14, 2024
  16. Mar 13, 2024
    • Maxim Kokryashkin's avatar
      ci: fix integration concurrency group · ced7c62b
      Maxim Kokryashkin authored
      In commit 13ac5daf ("ci: fix step parameters for reusable
      runs") the integration workflow was made reusable, but
      concurrency group pattern modification that was done for other
      workflows made reusable in the same patch was forgotten. This
      patch fixes the mentioned issue.
      
      NO_DOC=CI
      NO_TEST=CI
      NO_CHANGELOG=CI
      ced7c62b
  17. Mar 12, 2024
    • Alexander Turenko's avatar
      lyaml: fix alias serialization · 09bb3e96
      Alexander Turenko authored
      
      The #8350 was introduced by the commit b42302f5 ("lua-yaml: enable
      aliasing for objects returned by __serialize") so the patch is
      effectively reversed.
      
      The idea is to call all object __serialize methods recursively before
      finding references. The new serialization pass stores the mapping from
      the original object to the serialized representation.
      
      After this, the reference analysis pass and the encoding pass use this
      mapping to replace original objects with the serialized representation.
      
      As result, the reference analysis has a complete information about
      objects and no references are missed.
      
      Closes #8350
      Closes #8310
      Closes #8321
      
      NO_DOC=bugfix
      
      Co-authored-by: default avatarNikolay Shirokovskiy <nshirokovskiy@tarantool.org>
      (cherry picked from commit 610f5fb7)
      09bb3e96
  18. Mar 05, 2024
  19. Mar 01, 2024
  20. Feb 29, 2024
    • Maksim Kokryashkin's avatar
      ci: fix step parameters for reusable runs · 13ac5daf
      Maksim Kokryashkin authored
      This patch fixes three issues:
      1. It changes the condition for workflows so they can be run not
      only from the Tarantool repository but from any repository in the
      Tarantool organization.
      
      2. Reusable workflows substitute the `${{ github.workflow }}`
      context variable with the name of their top-level workflow. This
      behavior causes concurrency group clashes when several reusable
      workflows are called from a single top-level workflow. This patch
      adds an additional constant part to the concurrency group pattern
      to solve the issue.
      
      3. The checkout actions use the reference from the repository in
      which the top-level workflow is located instead of the one where
      the reusable workflow is located. This patch solves the issue by
      passing the reference explicitly.
      
      NO_DOC=CI
      NO_TEST=CI
      NO_CHANGELOG=CI
      13ac5daf
    • Maksim Kokryashkin's avatar
      ci: disable the reusable run for some workflows · d2c27a66
      Maksim Kokryashkin authored
      Some workflows are not relevant for integration testing.
      This patch disables them.
      
      NO_DOC=CI
      NO_TEST=CI
      NO_CHANGELOG=CI
      d2c27a66
    • Yaroslav Lobankov's avatar
      cmake: add libresolv to static dependency list · 42f7063b
      Yaroslav Lobankov authored
      If we run a static build with ASAN enabled via Clang 16, the build will
      fail unless `libresolv` is in the white list of static dependencies.
      It looks like it is a peculiarity of Clang 16 and higher.
      
      Fixes #9740
      
      NO_DOC=build
      NO_TEST=build
      NO_CHANGELOG=build
      
      (cherry picked from commit 8f6bc366)
      42f7063b
    • Igor Munkin's avatar
      test: remove LuaJIT-related CLI tests · bd81707f
      Igor Munkin authored
      There are two reasons for this changeset:
      
      * The positive one: Tarantool supports -b and -j options to use LuaJIT
        modules since the commit bf8b76a4
        ("lua: proxy -j and -b flags"), so the related tests from lua-Harness
        suite can be partially (since -O option is still not implemented in
        Tarantool) enabled.
      
      * The negative one: Tarantool diff-based tests for CLI interfaces are
        hard to maintain, if any change occurs in LuaJIT modules, since the
        aforementioned tests implement dumb comparison of the output, produced
        by the current CLI version against the expected one, managed by the
        .result file. Hence, to rule the tests related to the LuaJIT CLI
        interface in a more convenient way, the corresponding tests should be
        moved from the tests in the Tarantool repository to the tests in the
        LuaJIT repository.
      
      The recent LuaJIT bump landed to the master in the scope of commit
      0dcf6759 ("luajit: bump new version")
      enables the nice checks implemented in the lua-Harness suite; this patch
      removes the barely maintainable diff-based tests from this repository.
      
      Follows up #5541
      
      NO_DOC=test
      NO_CHANGELOG=test
      
      (cherry picked from commit 137e9156)
      bd81707f
  21. Feb 28, 2024
    • Sergey Kaplun's avatar
      luajit: bump new version · 394837ad
      Sergey Kaplun authored
      * cmake: introduce AddTestLib macro
      * test: prepare lauxilarily libs for LuaJIT-tests
      * test: separate LuaJIT helpers from ffi_util.inc
      * test: enable <ffi_arith_ptr.lua> in LuaJIT-tests
      * test: enable <ffi_bitfield.lua> in LuaJIT-tests
      * test: enable <ffi_call.lua> in LuaJIT-tests
      * test: enable <ffi_callback.lua> in LuaJIT-tests
      * test: enable <ffi_const.lua> in LuaJIT-tests
      * test: enable <ffi_convert.lua> in LuaJIT-tests
      * test: enable <ffi_enum.lua> in LuaJIT-tests
      * test: enable <ffi_gcstep_recursive.lua>
      * test: enable <ffi_jit_arith.lua> in LuaJIT-tests
      * test: enable <ffi_jit_call.lua> in LuaJIT-tests
      * test: enable <ffi_jit_conv.lua> in LuaJIT-tests
      * test: enable <ffi_lex_number.lua> in LuaJIT-tests
      * test: enable <ffi_metatype.lua> in LuaJIT-tests
      * test: enable <ffi_new.lua> in LuaJIT-tests
      * test: enable <ffi_parse_array.lua> in LuaJIT-tests
      * test: enable <ffi_parse_basic.lua> in LuaJIT-tests
      * test: enable <ffi_parse_cdef.lua> in LuaJIT-tests
      * test: enable <ffi_parse_struct.lua> LuaJIT test
      * test: enable <ffi_tabov.lua> LuaJIT test
      * test: enable <lightud.lua> LuaJIT test
      * test: enable <api_call.lua> LuaJIT test
      * test: enable <catch_wrap.lua> LuaJIT test
      * test: enable <catch_cpp.lua> LuaJIT test
      * test: introduce routine to build error message
      * test: enable CLI-related lua-Harness tests back
      
      Closes #7834
      Part of #9398
      Follows up #5541
      
      NO_DOC=LuaJIT submodule bump
      NO_TEST=LuaJIT submodule bump
      NO_CHANGELOG=add new tests
      394837ad
    • Yaroslav Lobankov's avatar
      test: disable app-tap/iconv.test.lua on RED OS · e7c870c5
      Yaroslav Lobankov authored
      Disable the app-tap/iconv.test.lua test on RED OS due to missing
      character encodings (UTF-16, UTF-16BE, etc).
      
      NO_DOC=test
      NO_TEST=test
      NO_CHANGELOG=test
      e7c870c5
    • Sergey Vorontsov's avatar
      build: enable LTO for RedOS 7+ · a4df36d5
      Sergey Vorontsov authored
      Enable LTO in the rpm spec file for RedOS 7+. Otherwise, we are getting
      a compilation error.
      
      NO_DOC=build
      NO_TEST=build
      NO_CHANGELOG=build
      a4df36d5
  22. Feb 19, 2024
    • Timur Safin's avatar
      datetime: fix strptime for fuzzer · cd32470e
      Timur Safin authored
      Google fuzzing efforts revealed yet another bound condition
      we don't handle well in the `tnt_strptime` function:
      
      - for format `%m%g%W`;
      - and input string `07001`.
      
      We failed with assertion failure:
      ```
        | datetime_strptime_fuzzer: ./src/lib/core/datetime.c:148: \
      _Bool tm_to_datetime(struct tnt_tm *, struct datetime *): \
      Assertion `mday >= 1 && mday <= 31' failed.
      ```
      
      Closes #8525
      
      NO_TEST=updated fuzzer corpus
      NO_CHANGELOG=internal
      NO_DOC=internal
      
      (cherry picked from commit 4043664d)
      cd32470e
    • Alexander Turenko's avatar
      test: increase timeouts in on_shutdown tests · 1604a97a
      Alexander Turenko authored
      I got four fails on the given tests in a row on debug-asan job in CI for
      tarantool-ee.
      
      It seems, tarantool-ee is more sensitive to small timeouts, when the
      address sanitizer slows down the execution. Or I'm just lucky.
      
      Anyway, the given tests don't really need small timeouts: increasing it
      doesn't break any test logic, doesn't increase duration of the test in a
      successful case and doesn't increase it in case of a failure.
      
      The tests are more stable after the change: I verified it locally by
      running each of the tests in parallel many times on tarantool built with
      enabled address sanitizer.
      
      See the following commits for details about the given test cases and the
      problems behind.
      
      * commit 1fcfb8c2 ("app: start init script event loop explicitly")
      * commit 786eb2ac ("main: don't break graceful shutdown on init
        script exit")
      
      Follows up #9266
      Follows up #9411
      
      NO_DOC=test adjustment
      NO_CHANGELOG=see NO_DOC
      
      (cherry picked from commit dfca3c6c)
      1604a97a
Loading