mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-03-12 05:44:06 +00:00
stop treating capital cities as villages, memory leak on deadlock
This commit is contained in:
@@ -367,7 +367,7 @@ void nominatim_exportPlace(uint64_t place_id, PGconn * conn,
|
||||
// Add, modify or delete?
|
||||
if (prevQuerySet)
|
||||
{
|
||||
if ((PQgetvalue(prevQuerySet->res, 0, 14) && strcmp(PQgetvalue(prevQuerySet->res, 0, 14), "100") == 0) || PQntuples(querySet.res))
|
||||
if ((PQgetvalue(prevQuerySet->res, 0, 14) && strcmp(PQgetvalue(prevQuerySet->res, 0, 14), "100") == 0) || PQntuples(querySet.res) == 0)
|
||||
{
|
||||
// Delete
|
||||
if (writer_mutex) pthread_mutex_lock( writer_mutex );
|
||||
|
||||
@@ -343,13 +343,14 @@ void *nominatim_indexThread(void * thread_data_in)
|
||||
|
||||
updateStartTime = time(0);
|
||||
int done = 0;
|
||||
|
||||
if (thread_data->writer)
|
||||
{
|
||||
nominatim_exportPlaceQueries(place_id, thread_data->conn, &querySet);
|
||||
}
|
||||
|
||||
while(!done)
|
||||
{
|
||||
if (thread_data->writer)
|
||||
{
|
||||
nominatim_exportPlaceQueries(place_id, thread_data->conn, &querySet);
|
||||
}
|
||||
|
||||
|
||||
paramPlaceID = PGint32(place_id);
|
||||
paramValues[0] = (char *)¶mPlaceID;
|
||||
@@ -363,12 +364,14 @@ void *nominatim_indexThread(void * thread_data_in)
|
||||
if (strncmp(PQerrorMessage(thread_data->conn), "ERROR: deadlock detected", 25))
|
||||
{
|
||||
fprintf(stderr, "index_placex: UPDATE failed - deadlock, retrying\n");
|
||||
PQclear(res);
|
||||
sleep(rand() % 10);
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "index_placex: UPDATE failed: %s", PQerrorMessage(thread_data->conn));
|
||||
PQclear(res);
|
||||
sleep(5);
|
||||
sleep(rand() % 10);
|
||||
// exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user