This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-07-11
Channels
- # announcements (6)
- # architecture (14)
- # babashka (26)
- # beginners (22)
- # calva (11)
- # clj-kondo (2)
- # clj-on-windows (1)
- # cljsrn (10)
- # clojure (116)
- # clojure-europe (5)
- # clojure-uk (1)
- # clojurescript (5)
- # cursive (9)
- # datomic (21)
- # depstar (1)
- # events (1)
- # fulcro (2)
- # graalvm (17)
- # graalvm-mobile (28)
- # helix (3)
- # introduce-yourself (2)
- # jobs (2)
- # lsp (4)
- # meander (1)
- # off-topic (4)
- # pathom (5)
- # polylith (6)
- # practicalli (5)
- # reagent (67)
- # reitit (1)
- # releases (2)
- # shadow-cljs (24)
- # tools-deps (23)
I'm getting these messages quite often, 3 at a time, when I'm starting my REPL:
Downloading: org/clojure/clojure/maven-metadata.xml from datomic-cloud
It leads to a quite slow REPL startup:
$ time clj -M:test:dev -e "(time (require 'datomic.ion))"
Downloading: org/clojure/clojure/maven-metadata.xml from datomic-cloud
Downloading: org/clojure/clojure/maven-metadata.xml from datomic-cloud
Downloading: org/clojure/clojure/maven-metadata.xml from datomic-cloud
"Elapsed time: 56.775926 msecs"
clj -M:test:dev -e "(time (require 'datomic.ion))" 52.34s user 2.88s system 335% cpu 16.463 total
I saw on stack overflow that I might want to adjust <updatePolicy>daily</updatePolicy>
in my ~/.m2/settings.xml
, but some commenters said it didn't work for them, so they just disabled snapshot version resolution.
Since this phenomena does not occur on every startup, but I suspect only hourly, I'm not sure how to debug it.
Is there a recommended way to make these checks happen less often?what version of clj
are you using?
clj won't use those updatePolicy settings so I don't think that will have any effect (should be daily for things like snapshots)
but what you're seeing here seems to be checking for clojure, a lib that should be found before that in other repos like maven central. it seems a little odd that you're even getting this at all (but maybe it's checking and rechecking because that metadata file is missing on the s3 maven repo)
if you have an old clj, it's possible some changes that have been put in would help. 1.10.3.855 is current stable release
I've upgraded to 1.10.3.855, but that didn't help.
then i've updated the clojure version in my deps.edn
from 1.10.1
to 1.10.3
and now it's not looking for org/clojure/clojure/maven-metadata.xml
on datomic-cloud
.
HOWEVER, i've just moved from martian/martian {:mvn/version "0.1.16"}
to com.github.oliyh/martian {:mvn/version "0.1.17-SNAPSHOT"}
and now im getting similar messages, roughly every 10-15 minutes, when I start a fresh Clojure CLI process, even just clojure -A:dev:test -Stree
:
Downloading: com/github/oliyh/martian/0.1.17-SNAPSHOT/maven-metadata.xml from datomic-cloud
Downloading: com/github/oliyh/martian-clj-http/0.1.17-SNAPSHOT/maven-metadata.xml from datomic-cloud
Downloading: com/github/oliyh/martian-httpkit/0.1.17-SNAPSHOT/maven-metadata.xml from datomic-cloud
Downloading: martian/martian/0.1.17-SNAPSHOT/maven-metadata.xml from datomic-cloud
Downloading: martian/martian/0.1.17-SNAPSHOT/maven-metadata.xml from datomic-cloud
Downloading: com/github/oliyh/martian-clj-http/0.1.17-SNAPSHOT/maven-metadata.xml from datomic-cloud
Downloading: com/github/oliyh/martian-httpkit/0.1.17-SNAPSHOT/maven-metadata.xml from datomic-cloud
Downloading: martian/martian/0.1.17-SNAPSHOT/maven-metadata.xml from datomic-cloud
Downloading: com/github/oliyh/martian/0.1.17-SNAPSHOT/maven-metadata.xml from datomic-cloud
what's weird, is that the same artifact is reported multiple times.
is that some retry logic?this may just be an artifact of the snapshot update logic. if it's checking every repo every time, it's never going to find that metadata file so it has to recheck again later
maven has the ability to mark repos as whether they even have snapshots and that would help here (we don't expose that option)
I just read through https://maven.apache.org/settings.html#repositories
That <repository> <snapshots> <enabled>false
or <updatePolicy>daily</updatePolicy>
would be a nice improvement to support.
Now that a bare Clojure terminal REPL starts up in less than a second, getting rid of these other sources of "slow Clojure startup" would be a great quality of life improvement, especially for early stage projects, where REPL startups are more frequent.
I'm even looking into Emacs and inf-clojure
again, beacause NOT using nREPL would shave another 1.7s from the startup time...
It occured to me that I should have looked into where this might have been reported, and indeed you have already said: > We don't currently expose the update policy settings of repositories but that's probably reasonable to do. here: https://clojure.atlassian.net/browse/TDEPS-97 , which is continued on this still open ticket, with patches, to support the maven repository options: https://clojure.atlassian.net/browse/TDEPS-101
I don't know that I want what's in those patches exactly, which is why this hasn't been moved forward
but it's helpful to me to know your experiences above
I logged the the request sent to my websocket handler and it included a hashmap with the key "input" and "Context". "Input" in the log contains a json payload "{\"headers...". Which ideally would be serialized to edn, but regardless, i would expect calling (get request "Input")
to return that string, instead, in the logs, im seeing it return null
.
I'm basically trying to do whats outlined here
https://www.freecodecamp.org/news/real-time-applications-using-websockets-with-aws-api-gateway-and-lambda-a5bb493e9452/
And so i believe i should be able to translate :
event.requestContext.connectionId;
into (get-in event ["requestContext" connectionId"]
Here is the handler:
(defn handler [request]
(cast/event {:msg "WebSocketRequest"
::request request
::input (get-in request ["Input"] )
::keys (keys request)
::type (type request)})
{:status 200 :body "foobar" })
And in the otuput we see the key "Input" but when i try to get the value, and log that, it comes back null.
{
"TomattoBackendDatomicIonWebsocketKeys": [
"Context",
"Input"
],
"TomattoBackendDatomicIonWebsocketRequest": {
"Context": <removed>
"Input": "{\"headers\": ...}"
},
"TomattoBackendDatomicIonWebsocketInput": null,
}
@U0DJ4T5U1 check https://docs.datomic.com/cloud/ions/ions-reference.html#entry-points Input and context are keywords. Of the request map. The value of :input is a json string so you’ll need to parse that.
@U0CJ19XAM I agree, the logs are saying the value of Input is a json string. But that string should still be returned as the value of (get-in request ["Input"])
right?
ah, ok. I'll check the docs but i take your meaning.
The casted log messages can be a little misleading because they are required to be json. A consequence of this is that all keywords are converted to strings.
It's reasonable, I'm not sure why I didn't think of that.