Skip to content
Snippets Groups Projects
Commit 19bc1625 authored by Sergey Yakubov's avatar Sergey Yakubov
Browse files

fix memora bug in producer

parent 18eef19c
No related branches found
No related tags found
No related merge requests found
......@@ -100,6 +100,9 @@ Error ProducerImpl::Send(const EventHeader& event_header,
bool manage_data_memory) {
auto err = CheckProducerRequest(event_header, ingest_mode);
if (err) {
if (!manage_data_memory) {
data.release();
}
log__->Error("error checking request - " + err->Explain());
return err;
}
......@@ -230,6 +233,7 @@ Error ProducerImpl::SendData__(const EventHeader& event_header,
FileData data_wrapped = FileData{(uint8_t*)data};
if (auto err = CheckData(ingest_mode, event_header, &data_wrapped)) {
data_wrapped.release();
return err;
}
......
......@@ -125,7 +125,6 @@ cdef class PyProducer:
Py_XINCREF(<PyObject*>data)
if callback != None:
Py_XINCREF(<PyObject*>callback)
return
cdef EventHeader create_event_header(self,uint64_t id, exposed_path,user_meta,subset,ingest_mode):
cdef EventHeader event_header
......
......@@ -91,8 +91,8 @@ else:
sys.exit(1)
try:
producer.send_file(0, local_path="./not_exist", exposed_path="./whatever",
ingest_mode=asapo_producer.INGEST_MODE_TRANSFER_METADATA_ONLY, callback=callback)
producer.send_data(0, "processed/" + stream + "/" + "file6", b"hello",
ingest_mode=asapo_producer.DEFAULT_INGEST_MODE, callback=callback)
except asapo_producer.AsapoWrongInputError as e:
print(e)
else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment