Changeset: c9e49e351f46 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/c9e49e351f46
Modified Files:
        sql/backends/monet5/rel_bin.c
        sql/test/BugTracker-2025/Tests/All
Branch: default
Log Message:

Merge with Mar2025 branch.


diffs (63 lines):

diff --git a/tools/merovingian/daemon/handlers.c 
b/tools/merovingian/daemon/handlers.c
--- a/tools/merovingian/daemon/handlers.c
+++ b/tools/merovingian/daemon/handlers.c
@@ -301,6 +301,7 @@ childhandler(void)
                        if (p->pid == pid) {
                                /* log everything that's still in the pipes */
                                logFD(p, 0, "MSG", p->dbname, (long long 
int)p->pid, _mero_logfile, true);
+                               logFD(p, 1, "ERR", p->dbname, (long long 
int)p->pid, _mero_logfile, true);
                                p->pid = -1;    /* indicate the process is dead 
*/
 
                                /* close the descriptors */
diff --git a/tools/merovingian/daemon/merovingian.c 
b/tools/merovingian/daemon/merovingian.c
--- a/tools/merovingian/daemon/merovingian.c
+++ b/tools/merovingian/daemon/merovingian.c
@@ -151,6 +151,7 @@ logFD(dpair dp, int fd, const char *type
        char *p, *q;
        struct tm *tmp;
        char mytime[20];
+       bool do_repeat = rest;
 
        assert(fd == 0 || fd == 1);
        do {
@@ -159,7 +160,7 @@ logFD(dpair dp, int fd, const char *type
                  repeat:
                        n = read(dp->input[fd].fd, buf + len, sizeof(buf) - len 
- 1);
                        if (n <= 0) {
-                               rest = false;
+                               do_repeat = false;
                                break;
                        }
                        len += n;
@@ -202,7 +203,7 @@ logFD(dpair dp, int fd, const char *type
                                /* shorten message with reference to logfile */
                                *s = '\0';
                        }
-                       if (dp->input[fd].cnt < 30000 && 
strcmp(dp->input[fd].buf, q) == 0) {
+                       if (!rest && dp->input[fd].cnt < 30000 && 
strcmp(dp->input[fd].buf, q) == 0) {
                                /* repeat of last message */
                                dp->input[fd].cnt++;
                                dp->input[fd].ts = now;
@@ -227,7 +228,21 @@ logFD(dpair dp, int fd, const char *type
                        }
                }
                fflush(stream);
-       } while (rest);
+       } while (do_repeat);
+       if (rest && dp->input[fd].cnt > 0) {
+               /* last message was repeated but not all repeats reported */
+               char tmptime[20];
+               strftime(tmptime, sizeof(tmptime), "%Y-%m-%d %H:%M:%S",
+                                localtime(&dp->input[fd].ts));
+               if (dp->input[fd].cnt == 1)
+                       fprintf(stream, "%s %s %s[%lld]: %s\n",
+                                       tmptime, type, dbname, pid, 
dp->input[fd].buf);
+               else
+                       fprintf(stream, "%s %s %s[%lld]: message repeated %d 
times: %s\n",
+                                       tmptime, type, dbname, pid, 
dp->input[fd].cnt, dp->input[fd].buf);
+               dp->input[fd].cnt = 0;
+               dp->input[fd].buf[0] = 0;
+       }
        fflush(stream);
 }
 
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to