Skip to content

Commit

Permalink
removed offending code in atl06 proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
jpswinski committed Aug 10, 2022
1 parent dfd48d2 commit 9af45ca
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
5 changes: 1 addition & 4 deletions packages/core/TcpSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,7 @@ TcpSocket::TcpSocket(lua_State* L, const char* _ip_addr, int _port, bool _server
{
connector = NULL;
sock = SockLib::sockstream(ip_addr, port, is_server, block);
if(sock != INVALID_RC)
{
mlog(INFO, "Connection established to %s:%d", ip_addr, port);
}
if(sock >= 0) mlog(INFO, "Connection [%d] established to %s:%d", sock, ip_addr, port);
}
else
{
Expand Down
21 changes: 11 additions & 10 deletions plugins/icesat2/plugin/Atl06Proxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,26 +252,28 @@ Atl06Proxy::Atl06Proxy (lua_State* L, const char** _resources, int _num_resource
*----------------------------------------------------------------------------*/
Atl06Proxy::~Atl06Proxy (void)
{
printf("OH NO, why are we here\n");
for(int i = 0; i < numRequests; i++)
{
requests[i].sync.lock();
{
if(!requests[i].complete)
{
requests[i].sync.wait(0, NODE_LOCK_TIMEOUT * 1000);
if(requests[i].sync.wait(0, NODE_LOCK_TIMEOUT * 1000))
{
delete [] requests[i].resource;
}
else
{
mlog(CRITICAL, "Memory leak due to unfinished proxied request: %s", requests[i].resource);
}
}
}
requests[i].sync.unlock();

delete [] requests[i].resource;
}
delete [] requests;

delete [] parameters;

delete outQ;

delete [] orchestratorURL;
}

Expand All @@ -290,16 +292,15 @@ void* Atl06Proxy::proxyThread (void* parm)
{
atl06_rqst_t* rqst = (atl06_rqst_t*)ref.data;
Atl06Proxy* proxy = rqst->proxy;
HttpClient orchestrator(NULL, rqst->proxy->orchestratorURL);
// HttpClient orchestrator(NULL, rqst->proxy->orchestratorURL);
const char* resource = rqst->resource;
printf(">>> %s - %d\n", resource, rqst->index);
try
{
/* Get Lock from Orchestrator */
mlog(INFO, "Processing resource: %s", resource);
SafeString orch_rqst_data("{'service':'test', 'nodesNeeded': 1, 'timeout': %d}", NODE_LOCK_TIMEOUT);
HttpClient::rsps_t rsps = orchestrator.request(EndpointObject::GET, "/discovery/lock", orch_rqst_data.getString(), false);
print2term("%s\n", rsps.response);
// HttpClient::rsps_t rsps = orchestrator.request(EndpointObject::GET, "/discovery/lock", orch_rqst_data.getString(), false, NULL);
// print2term("%s\n", rsps.response);

// pass request to node

Expand Down

0 comments on commit 9af45ca

Please sign in to comment.