Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thread names don't include numbers #38

Closed
pmonks opened this issue Nov 13, 2020 · 3 comments
Closed

Thread names don't include numbers #38

pmonks opened this issue Nov 13, 2020 · 3 comments

Comments

@pmonks
Copy link

pmonks commented Nov 13, 2020

Despite this code, I'm not seeing chime's threads include a number in their name, making debugging slightly more difficult.

Here's a log excerpt produced by my code, showing the problematic thread names:

2020-11-13T00:00:00.001627+00:00 app[bot.1]: INFO  [chime-] futbot.core - Youtube channel -unknown (UCmzFaEBQlLmMTWS0IQ90tgA)- job started...
2020-11-13T00:00:00.001960+00:00 app[bot.1]: INFO  [chime-] futbot.core - Daily schedule job started...
2020-11-13T00:00:00.108573+00:00 app[bot.1]: ERROR [chime-] futbot.core - Unexpected exception in Youtube channel -unknown (UCmzFaEBQlLmMTWS0IQ90tgA)- job
2020-11-13T00:00:00.108583+00:00 app[bot.1]: clojure.lang.ExceptionInfo: Google API call (https://www.googleapis.com/youtube/v3/search?part=snippet&order=date&type=video&maxResults=50&channelId=UCmzFaEBQlLmMTWS0IQ90tgA&publishedAfter=2020-11-12T00:00:00.002427Z&key=REDACTED) failed
2020-11-13T00:00:00.108755+00:00 app[bot.1]: INFO  [chime-] futbot.core - Youtube channel -unknown (UCmzFaEBQlLmMTWS0IQ90tgA)- job finished
2020-11-13T00:00:00.920143+00:00 app[bot.1]: INFO  [chime-] futbot.jobs - No matches remaining today - not scheduling any reminders.
2020-11-13T00:00:00.920324+00:00 app[bot.1]: INFO  [chime-] futbot.core - Daily schedule job finished

This excerpt shows two different jobs ("Youtube channel -unknown (UCmzFaEBQlLmMTWS0IQ90tgA)- job" and "Daily schedule job") that just happen to be scheduled to run at the same time (midnight UTC), resulting in their log output being interleaved. This makes it somewhat more difficult to properly correlate individual log entries with each job.

Oh and for reference, here's the log output pattern I'm using (my app uses Logback classic) - note in particular that it does not truncate the thread name component, meaning if the thread names had included a number, it would be visible:

      <pattern>%date %-5level [%thread] %logger{30} - %msg%n</pattern>
@pmonks
Copy link
Author

pmonks commented Nov 18, 2020

Simple reproduction:

user=> (require '[java-time :as tm])
nil
user=> (require '[chime.core :as chime])
nil
user=> (chime/chime-at [(tm/plus (tm/instant) (tm/seconds 5))] (fn [_] (println "Thread name:" (.getName (Thread/currentThread)))))
Thread name: chime-
#object[chime.core$chime_at$reify__19728 0x2bae60e8 {:status :ready, :val nil}]
user=>

@jarohen
Copy link
Owner

jarohen commented Nov 20, 2020

Thanks for the report @pmonks - this is an as-yet-unreleased duplicate of #33 - will get a release out shortly

@jarohen jarohen closed this as completed Nov 20, 2020
@pmonks
Copy link
Author

pmonks commented Nov 21, 2020

Oh doh - for some reason I didn't even think to look for duplicates. Sorry about that, and thanks for the pointer!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants