Comments (4)
能仔细描述下用法和现象吗
from tera.
就是在子进程中调用tera的接口,会出现如题中的问题,我举个例子吧,代码如下:
#include
#include
#include
#include
#include
#include
#include "tera.h"
void fun() {
tera::ErrorCode error_code;
tera::Client* client = tera::Client::NewClient("./tera.flag", &error_code);
tera::Table* table = client->OpenTable("tera_testxxx", &error_code);
if (table == NULL) {
printf("Open talbe fail:%s \n", strerr(error_code));
}
std::string key = "1343423432423";
tera::RowMutation* mutation = table->NewRowMutation(key);
mutation->Put("1","1","value1");
table->ApplyMutation(mutation);
std::string value;
table->Get(key, "1", "1", &value, &error_code);
std::cout << value << std::endl;
delete table;
delete client;
}
int main() {
pid_t pid;
pid = fork();
if (pid > 0) {
pid_t child_pid;
int stat_val;
child_pid = wait(&stat_val);
printf("after wait child\n");
}else if (pid == 0) {
printf("this is child\n");
fun();
}else {
printf("fork error\n");
}
return 0;
}
在fun函数的第三行也就是,打开table,会挂起信号量,gdb查看如下:
Reading symbols from /usr/lib64/libk5crypto.so.3...done.
Loaded symbols for /usr/lib64/libk5crypto.so.3
Reading symbols from /lib64/libresolv.so.2...done.
Loaded symbols for /lib64/libresolv.so.2
Reading symbols from /lib64/libnss_files.so.2...done.
Loaded symbols for /lib64/libnss_files.so.2
Reading symbols from /lib64/libnss_dns.so.2...done.
Loaded symbols for /lib64/libnss_dns.so.2
0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/tls/libpthread.so.0
(gdb) bt
#0 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/tls/libpthread.so.0
#1 0x00007faa61ba4de3 in common::CondVar::Wait (this=0xd4b478, msg=0x0) at ./src/common/mutex.h:127
#2 0x00007faa61bd4dc2 in tera::TableImpl::UpdateTableMeta (this=0xd4b200, err=0x7fff30a96200) at src/sdk/table_impl.cc:1840
#3 0x00007faa61bc9cf1 in tera::TableImpl::OpenInternal (this=0xd4b200, err=0x7fff30a96200) at src/sdk/table_impl.cc:412
#4 0x00007faa61ba0639 in tera::ClientImpl::OpenTable (this=0xd82000, table_name=@0x7fff30a961d0, options=@0x7fff30a96127, err=0x7fff30a96200) at src/sdk/client_impl.cc:278
#5 0x00007faa61ba04b9 in tera::ClientImpl::OpenTable (this=0xd82000, table_name=@0x7fff30a961d0, err=0x7fff30a96200) at src/sdk/client_impl.cc:262
#6 0x00000000004011bd in fun () at mulpro.cpp:13
#7 0x000000000040172f in main () at mulpro.cpp:39
from tera.
应该跟子进程无关吧,父进程不也是shell的子进程?
from tera.
那这个是什么原因导致的呢?
from tera.
Related Issues (20)
- fix teracli scan null key
- leveldb数据爆增 HOT 7
- The safe mode threshold is too high
- 现在除了百度,还有哪些企业在用tera? HOT 3
- Add UnitTest for trackable gc
- trackable gc cannot clean empty tablet dir
- remove IncrementalGcStrategy
- SDK发送一个任务给服务器成功后,过了一定时间SDK内部超时管理器认为任务超时,返回错误码给teracli,teracli析构了TableImpl,但是这时服务器把先前的任务又返回了,但是TableImpl已经析构了,就会崩溃是吗? HOT 5
- when a tabletnode node dead, tablets on it cannot use until this node is ready? HOT 6
- stop master and does not use kill -9 , master will crash at MasterZkAdapter destruction func。error code Device or resource busy HOT 4
- 异步Put操作,Table实例释放问题。 HOT 3
- 通过Append接口放入多条数据,读出来时会有数据丢失 HOT 1
- 内存泄漏问题 HOT 3
- build.sh package not found HOT 1
- Scan on non-existent column family should fail earlier
- 这里可能有一个bug? HOT 1
- merge 2.14 to master
- tera 是线上检索的doc server吗? HOT 2
- tera client客户端连接问题 HOT 3
- 请问是否有GlobalTranaction 介绍文档呢? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tera.