Changeset: 8535680a9004 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/8535680a9004
Modified Files:
monetdb5/mal/mal.c
monetdb5/mal/mal_embedded.c
monetdb5/mal/mal_instruction.c
monetdb5/mal/mal_namespace.c
Branch: Sep2022
Log Message:
Make sure mal_exit is only ever called from the main thread.
diffs (52 lines):
diff --git a/monetdb5/mal/mal.c b/monetdb5/mal/mal.c
--- a/monetdb5/mal/mal.c
+++ b/monetdb5/mal/mal.c
@@ -250,8 +250,6 @@ void mal_reset(void)
* terminate this way.
* We should also ensure that no new client enters the scene while shutting
down.
* For this we mark the client records as BLOCKCLIENT.
- *
- * Beware, mal_exit is also called during a SIGTERM from the monetdb tool
*/
void mal_exit(int status)
diff --git a/monetdb5/mal/mal_embedded.c b/monetdb5/mal/mal_embedded.c
--- a/monetdb5/mal/mal_embedded.c
+++ b/monetdb5/mal/mal_embedded.c
@@ -207,8 +207,6 @@ malEmbeddedReset(void) //remove extra mo
* terminate this way.
* We should also ensure that no new client enters the scene while shutting
down.
* For this we mark the client records as BLOCKCLIENT.
- *
- * Beware, mal_exit is also called during a SIGTERM from the monetdb tool
*/
void
diff --git a/monetdb5/mal/mal_instruction.c b/monetdb5/mal/mal_instruction.c
--- a/monetdb5/mal/mal_instruction.c
+++ b/monetdb5/mal/mal_instruction.c
@@ -480,8 +480,8 @@ newInstructionArgs(MalBlkPtr mb, const c
* Furthermore, failure to allocate such a small data structure
indicates we are in serious trouble.
* The only way out is declare it a fatal error, terminate the
system to avoid crashes in all kind of places.
*/
- GDKerror(SQLSTATE(HY013) MAL_MALLOC_FAIL);
- mal_exit(1);
+ GDKfatal(SQLSTATE(HY013) MAL_MALLOC_FAIL);
+ exit(1);
}
p->maxarg = args;
p->typechk = TYPE_UNKNOWN;
diff --git a/monetdb5/mal/mal_namespace.c b/monetdb5/mal/mal_namespace.c
--- a/monetdb5/mal/mal_namespace.c
+++ b/monetdb5/mal/mal_namespace.c
@@ -122,8 +122,8 @@ static const char *findName(const char *
struct namespace *ns = GDKmalloc(sizeof(struct namespace));
if (ns == NULL) {
/* error we cannot recover from */
- TRC_CRITICAL(MAL_SERVER, MAL_MALLOC_FAIL "\n");
- mal_exit(1);
+ GDKfatal(MAL_MALLOC_FAIL);
+ exit(1);
}
ns->next = namespace;
ns->count = 0;
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]