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

Unreadable forms in certain eval-in-project calls #2328

Closed
technomancy opened this issue Oct 19, 2017 · 8 comments
Closed

Unreadable forms in certain eval-in-project calls #2328

technomancy opened this issue Oct 19, 2017 · 8 comments
Labels
Milestone

Comments

@technomancy
Copy link
Owner

Sometimes eval-in-project calls will result in forms that contain unreadable #object... elements.

I have only been able to reproduce the problem with lein eastwood but others report problems with built-in tasks or with lein ring.

In the instance with eastwood, somehow the entire project map is being attached as metadata to the form being evaluated, and the metadata contains merge directives like reduce-dep-step which is a function.

@ccann
Copy link

ccann commented Oct 19, 2017

I'm not sure if it's the same issue, but both eastwood and bikeshed fail for me with the same Caused by: java.lang.RuntimeException: No reader function for tag ... when compiling the target directory of the project.

I also get this line:
Java HotSpot(TM) 64-Bit Server VM warning: Unable to open cgroup memory limit file /sys/fs/cgroup/memory/memory.limit_in_bytes (No such file or directory)

@pmonks
Copy link
Contributor

pmonks commented Oct 19, 2017

<digression warning>
The Java HotSpot(TM) 64-Bit Server VM warning: Unable to open cgroup memory limit file /sys/fs/cgroup/memory/memory.limit_in_bytes (No such file or directory) warning is unrelated - it's coming from the JVM, and is a side effect of the fix for #2304. While quite annoying, my gut tells me that that fix is "right", and that instead the JVM should not be complaining so loudly when it can't read the cgroups info.

@technomancy
Copy link
Owner Author

@pmonks if that path is predictable we could check for its existence before adding the flag to the :jvm-opts.

@jafingerhut
Copy link
Contributor

I have done a tiny bit of investigation, and at least so far it appears that the reduce-dep-step things with #object tags are there both with Leiningen 2.7.1, and also with Leiningen 2.8.0. If it would be helpful, I can release to Clojars a version of Eastwood that enables dumping the project map that it passes to eval-in-project, showing metadata as well as the normal data.

@technomancy
Copy link
Owner Author

@jafingerhut thanks; I can just locally install a snapshot version which has what I need. I'm just confused as to why certain uses of eval-in-project trigger this and others don't; eastwood doesn't appear to be doing anything unusual with the form being evaluated.

@jafingerhut
Copy link
Contributor

OK. Just in case it may be helpful, I went ahead and released Eastwood version 0.2.6-beta2 to clojars. If you run "lein eastwood lein-project" with earlier Eastwood versions, it pretty-prints the Leiningen project map, but without the metadata shown. With 0.2.6-beta2 it also shows the metadata. Running with that command line stops immediately after showing that map, without doing linting like Eastwood normally would.

You can also run:

lein eastwood '{:debug [:options]}'

and it will print out debug info, including the Leiningen project map with metadata, and then continue linting as normal.

@pmonks
Copy link
Contributor

pmonks commented Oct 19, 2017

@technomancy wrote:

if that path is predictable we could check for its existence before adding the flag to the :jvm-opts.

Yeah that'd be handy, though sadly I don't think it is that predictable. My skim reading of JDK-8146115 leads me to suspect that the JVM checks a couple of different things to try to determine what the cgroups limits are.

Perhaps the best path is to raise an issue against Java, asking them to shush the JVM up a bit when -XX:+UseCGroupMemoryLimitForHeap doesn't find a cgroups limit? Though silently failing also has problems... 😢

@technomancy
Copy link
Owner Author

I tracked this down to a change which was applied in #2306; before that we did not print metadata when writing out code for eval-in-project's :subprocess method. I think that change needs to be reverted; it was only applied in order to avoid a reflection warning, and this problem is much more serious.

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

No branches or pull requests

4 participants