You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by "traeak (via GitHub)" <gi...@apache.org> on 2023/06/29 20:57:20 UTC

[GitHub] [trafficserver] traeak opened a new pull request, #9934: Add more debug to the regex_revalidate main handler.

traeak opened a new pull request, #9934:
URL: https://github.com/apache/trafficserver/pull/9934

   This also updates and adds to the autests and treats the time_t like an int64_t (cleans up the logic).  Also adds extra warning to documentation about using this with MISS(refetch) which requires the parent be an origin and not another cdn.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [trafficserver] traeak commented on a diff in pull request #9934: Add more debug to the regex_revalidate main handler.

Posted by "traeak (via GitHub)" <gi...@apache.org>.
traeak commented on code in PR #9934:
URL: https://github.com/apache/trafficserver/pull/9934#discussion_r1273929915


##########
plugins/regex_revalidate/regex_revalidate.c:
##########
@@ -251,9 +256,9 @@ prune_config(invalidate_t **i)
     iptr  = *i;
     ilast = NULL;
     while (iptr) {
-      if (difftime(iptr->expiry, now) < 0) {
-        TSDebug(PLUGIN_NAME, "Removing %s expiry: %d type: %s now: %d", iptr->regex_text, (int)iptr->expiry,
-                strForResult(iptr->new_result), (int)now);
+      if (iptr->expiry <= now) {
+        TSDebug(PLUGIN_NAME, "Removing %s expiry: %jd type: %s now: %jd", iptr->regex_text, (intmax_t)iptr->expiry,
+                strForResult(iptr->new_result), (intmax_t)now);

Review Comment:
   because the plugin is still 'c' and it won't compile.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [trafficserver] traeak merged pull request #9934: Add more debug to the regex_revalidate main handler.

Posted by "traeak (via GitHub)" <gi...@apache.org>.
traeak merged PR #9934:
URL: https://github.com/apache/trafficserver/pull/9934


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [trafficserver] ywkaras commented on a diff in pull request #9934: Add more debug to the regex_revalidate main handler.

Posted by "ywkaras (via GitHub)" <gi...@apache.org>.
ywkaras commented on code in PR #9934:
URL: https://github.com/apache/trafficserver/pull/9934#discussion_r1272933955


##########
plugins/regex_revalidate/regex_revalidate.c:
##########
@@ -462,20 +468,20 @@ load_config(plugin_state_t *pstate, invalidate_t **ilist)
             }
             if (i) {
               iptr->next = i;
-              TSDebug(PLUGIN_NAME, "Loaded %s %d %d %s", i->regex_text, (int)i->epoch, (int)i->expiry, strForResult(i->new_result));
+              TSDebug(PLUGIN_NAME, "Loaded %s %jd %jd %s", i->regex_text, i->epoch, i->expiry, strForResult(i->new_result));
             }
           }
         }
       } else {
-        TSDebug(PLUGIN_NAME, "Skipping line %d", ln);
+        TSDebug(PLUGIN_NAME, "Skipping line %d, too few fields", ln);
       }
     }
     pcre_free(config_re);
     fclose(fs);
     pstate->last_load = s.st_mtime;
     return true;
   } else {
-    TSDebug(PLUGIN_NAME, "File mod time is not newer: %d >= %d", (int)pstate->last_load, (int)s.st_mtime);
+    TSDebug(PLUGIN_NAME, "File mod time is not newer: ftime: %jd <= last_load: %jd", s.st_mtime, pstate->last_load);

Review Comment:
   ditto



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [trafficserver] traeak commented on a diff in pull request #9934: Add more debug to the regex_revalidate main handler.

Posted by "traeak (via GitHub)" <gi...@apache.org>.
traeak commented on code in PR #9934:
URL: https://github.com/apache/trafficserver/pull/9934#discussion_r1273646891


##########
plugins/regex_revalidate/regex_revalidate.c:
##########
@@ -462,20 +468,20 @@ load_config(plugin_state_t *pstate, invalidate_t **ilist)
             }
             if (i) {
               iptr->next = i;
-              TSDebug(PLUGIN_NAME, "Loaded %s %d %d %s", i->regex_text, (int)i->epoch, (int)i->expiry, strForResult(i->new_result));
+              TSDebug(PLUGIN_NAME, "Loaded %s %jd %jd %s", i->regex_text, i->epoch, i->expiry, strForResult(i->new_result));
             }
           }
         }
       } else {
-        TSDebug(PLUGIN_NAME, "Skipping line %d", ln);
+        TSDebug(PLUGIN_NAME, "Skipping line %d, too few fields", ln);
       }
     }
     pcre_free(config_re);
     fclose(fs);
     pstate->last_load = s.st_mtime;
     return true;
   } else {
-    TSDebug(PLUGIN_NAME, "File mod time is not newer: %d >= %d", (int)pstate->last_load, (int)s.st_mtime);
+    TSDebug(PLUGIN_NAME, "File mod time is not newer: ftime: %jd <= last_load: %jd", s.st_mtime, pstate->last_load);

Review Comment:
   ditto



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [trafficserver] ywkaras commented on a diff in pull request #9934: Add more debug to the regex_revalidate main handler.

Posted by "ywkaras (via GitHub)" <gi...@apache.org>.
ywkaras commented on code in PR #9934:
URL: https://github.com/apache/trafficserver/pull/9934#discussion_r1272934300


##########
plugins/regex_revalidate/regex_revalidate.c:
##########
@@ -502,13 +508,13 @@ list_config(plugin_state_t *pstate, invalidate_t *i)
     iptr = i;
     while (iptr) {
       char const *const typestr = strForResult(iptr->new_result);
-      TSDebug(PLUGIN_NAME, "%s epoch: %d expiry: %d result: %s", iptr->regex_text, (int)iptr->epoch, (int)iptr->expiry, typestr);
+      TSDebug(PLUGIN_NAME, "%s epoch: %jd expiry: %jd result: %s", iptr->regex_text, iptr->epoch, iptr->expiry, typestr);

Review Comment:
   ditto all of these too.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [trafficserver] traeak commented on a diff in pull request #9934: Add more debug to the regex_revalidate main handler.

Posted by "traeak (via GitHub)" <gi...@apache.org>.
traeak commented on code in PR #9934:
URL: https://github.com/apache/trafficserver/pull/9934#discussion_r1273646443


##########
plugins/regex_revalidate/regex_revalidate.c:
##########
@@ -462,20 +468,20 @@ load_config(plugin_state_t *pstate, invalidate_t **ilist)
             }
             if (i) {
               iptr->next = i;
-              TSDebug(PLUGIN_NAME, "Loaded %s %d %d %s", i->regex_text, (int)i->epoch, (int)i->expiry, strForResult(i->new_result));
+              TSDebug(PLUGIN_NAME, "Loaded %s %jd %jd %s", i->regex_text, i->epoch, i->expiry, strForResult(i->new_result));

Review Comment:
   thanks, changed



##########
plugins/regex_revalidate/regex_revalidate.c:
##########
@@ -502,13 +508,13 @@ list_config(plugin_state_t *pstate, invalidate_t *i)
     iptr = i;
     while (iptr) {
       char const *const typestr = strForResult(iptr->new_result);
-      TSDebug(PLUGIN_NAME, "%s epoch: %d expiry: %d result: %s", iptr->regex_text, (int)iptr->epoch, (int)iptr->expiry, typestr);
+      TSDebug(PLUGIN_NAME, "%s epoch: %jd expiry: %jd result: %s", iptr->regex_text, iptr->epoch, iptr->expiry, typestr);

Review Comment:
   ditto



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [trafficserver] ywkaras commented on a diff in pull request #9934: Add more debug to the regex_revalidate main handler.

Posted by "ywkaras (via GitHub)" <gi...@apache.org>.
ywkaras commented on code in PR #9934:
URL: https://github.com/apache/trafficserver/pull/9934#discussion_r1272933675


##########
plugins/regex_revalidate/regex_revalidate.c:
##########
@@ -462,20 +468,20 @@ load_config(plugin_state_t *pstate, invalidate_t **ilist)
             }
             if (i) {
               iptr->next = i;
-              TSDebug(PLUGIN_NAME, "Loaded %s %d %d %s", i->regex_text, (int)i->epoch, (int)i->expiry, strForResult(i->new_result));
+              TSDebug(PLUGIN_NAME, "Loaded %s %jd %jd %s", i->regex_text, i->epoch, i->expiry, strForResult(i->new_result));

Review Comment:
   What guarantees that the times will be of type intmax_t?  You could change to `intmax_t(i->epoch)` to be sure.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [trafficserver] ywkaras commented on a diff in pull request #9934: Add more debug to the regex_revalidate main handler.

Posted by "ywkaras (via GitHub)" <gi...@apache.org>.
ywkaras commented on code in PR #9934:
URL: https://github.com/apache/trafficserver/pull/9934#discussion_r1273905882


##########
plugins/regex_revalidate/regex_revalidate.c:
##########
@@ -251,9 +256,9 @@ prune_config(invalidate_t **i)
     iptr  = *i;
     ilast = NULL;
     while (iptr) {
-      if (difftime(iptr->expiry, now) < 0) {
-        TSDebug(PLUGIN_NAME, "Removing %s expiry: %d type: %s now: %d", iptr->regex_text, (int)iptr->expiry,
-                strForResult(iptr->new_result), (int)now);
+      if (iptr->expiry <= now) {
+        TSDebug(PLUGIN_NAME, "Removing %s expiry: %jd type: %s now: %jd", iptr->regex_text, (intmax_t)iptr->expiry,
+                strForResult(iptr->new_result), (intmax_t)now);

Review Comment:
   Why don' t you wanna do these C++ style not C style?  `intmax_t(iptr->expiry)` not `(intmax_t)iptr->expiry`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org