Skip to content

Commit

Permalink
TRY MORE, +2
Browse files Browse the repository at this point in the history
  • Loading branch information
levb committed Nov 3, 2024
1 parent 0390c26 commit 6a883d3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/micro.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ static bool
_detach_service_from_connection(natsConnection *nc, microService *m)
{
bool removed = false;
int remaining = 0;
// int remaining = 0;

if (nc == NULL || m == NULL)
return false;
Expand All @@ -301,7 +301,7 @@ _detach_service_from_connection(natsConnection *nc, microService *m)
removed = true;
break;
}
remaining = nc->numServices;
// remaining = nc->numServices;
natsConn_Unlock(nc);
// printf("<>/<> _detachED_service_from_connection %s: remaining: %d, removed: %d\n", m->cfg->Name, remaining, removed); fflush(stdout);
return removed;
Expand Down Expand Up @@ -440,12 +440,12 @@ void micro_release_endpoint_when_unsubscribed(void *closure)
// Special processing for the last endpoint.
if (doneHandler != NULL)
{
doneHandler(m);

// Stop the service now in case it hasn't already and detach from the
// connection, no need to unsubscribe.
// printf("<>/<> Stopping service %s from micro_release_endpoint_when_unsubscribed\n", m->cfg->Name); fflush(stdout);
_stop_service(m, true, false, false);

doneHandler(m);
}
}

Expand Down
5 changes: 1 addition & 4 deletions test/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -33593,7 +33593,6 @@ _startManyMicroservices(microService** svcs, int n, natsConnection *nc, microSer

#define _waitForMicroservicesAllDone(_arg) \
{ \
nats_Sleep(valgrind ? 0 : 0); \
natsMutex_Lock((_arg)->m); \
testf("Wait for %d microservices to stop: ", (_arg)->microRunningServiceCount); \
natsStatus waitStatus = NATS_OK; \
Expand Down Expand Up @@ -33844,9 +33843,6 @@ void test_MicroAddService(void)
}

microServiceInfo_Destroy(info);

int64_t start = nats_Now();
int64_t nn;
_destroyMicroservice(m);
_waitForMicroservicesAllDone(&arg);
}
Expand Down Expand Up @@ -34565,6 +34561,7 @@ void test_MicroServiceStopsWhenServerStops(void)

_waitForMicroservicesAllDone(&arg);

// nats_Sleep(10); // <>/<>
test("Test microservice is not running: ");
testCond(microService_IsStopped(m))

Expand Down

0 comments on commit 6a883d3

Please sign in to comment.