tarantool::fiber::Fiber memory leak
Environment
Release / Commit: tarantool v 1.1.0
OS: Ubuntu 22.04 LTS
Rust version: 1.71
Steps to Reproduce
- Create test tarantool project. lib.rs:
use std::os::raw::c_int;
use std::time::Duration;
use tarantool::fiber;
use tarantool::fiber::Fiber;
use tarantool::tuple::{FunctionArgs, FunctionCtx};
#[no_mangle]
pub extern "C" fn easy(ctx: FunctionCtx, args: FunctionArgs) -> c_int {
for _ in 0..10_000_000 {
let mut ack_fiber = Fiber::new(&format!("ack_{}", tarantool::uuid::Uuid::random()), &mut |b: Box<(String, String)>| {
fiber::sleep(Duration::from_millis(10));
if &(*b).0 == &(*b).1 {
println!("unreachable");
}
0
});
ack_fiber.set_joinable(false);
ack_fiber.start(("str 1 2 3 4".to_string(), "str 4 5 6 7".to_string()));
fiber::sleep(Duration::from_millis(1));
}
ctx.return_mp(&()).unwrap();
0
}
- init.lua:
require('easy')
box.cfg({listen = 3301})
box.schema.func.create('easy', {language = 'C', if_not_exists = true})
box.schema.user.grant('guest', 'execute', 'function', 'easy', {if_not_exists = true})
function my_fn()
local v = box.func.easy:call()
print(v)
end
box.func.easy:call()
- Check htop, i got ~2mb leak per min.
Edited by Konstantin D