-
Notifications
You must be signed in to change notification settings - Fork 500
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
log file with a different instance root directory #10373
Conversation
@BenediktMeierUIT thanks for the pull request. Out of curiosity, what is your instance root? |
Benedikt as been working with us on dataverse.no |
Yes, this is a Docker. I'm not quite sure about another point. Why it was done differently.
(I don't have access to Slack :-( ) |
Sorry, can you please spell out a little more how it's done differently? From a quick look it seems more or less the same to me. |
Sorry... |
At that point, it's done differently again: dataverse/src/main/java/edu/harvard/iq/dataverse/harvest/client/HarvesterServiceBean.java Line 91 in 5caf436
I was going to change the line like this: public static final String DATAVERSE_HARVEST_STOP_FILE="stopharvest_"; and in the place: dataverse/src/main/java/edu/harvard/iq/dataverse/harvest/client/HarvesterServiceBean.java Line 402 in 5caf436
String stopFileName = System.getProperty("com.sun.aas.instanceRoot") + File.separator + "logs" + File.separator + DATAVERSE_HARVEST_STOP_FILE + harvestingClient.getName() + "." + pid;
|
This should be a JVM option defaulting to the system property as well as made consistent everywhere. |
It's funny, just today I was in DatasetServiceBean.java debugging something and I copied the fix from this PR because I'm in Docker and was hitting a problem without it. I'd say we definitely want this fix. And yes, a JVM option/MicroProfile Config setting eventually. In this PR or later. |
Yes, A JVM option/MicroProfile Config would be nice in the future but for now we should avoid overreaching this pull request and keep it confine to the bug fix that it is. |
Yes, sounds good to defer adding a JVM/MPConfig option until later. |
Adding the option is almost a one liner. Do you want me to create a small PR to this PR with it? @pdurbin if you leave a review after, I can do QA and we ship this one fast. |
If you give me the JVM/MPConfig name, I can change the format to what you want. |
Sure, I'm happy to do a review and let @poikilotherm do the QA. |
String logFileName = "../logs" + File.separator + "export_" + logTimestamp + ".log"; | ||
String logFileName = System.getProperty("com.sun.aas.instanceRoot") + File.separator + "logs" + File.separator + "export_" + logTimestamp + ".log"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can vouch for the need for this change. Without it, I couldn't get some code I was playing with to execute. I was exporting some JSON for troubleshooting: pdurbin@8adb28d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like within a container, the application has a different working directory than in a classic deployment. Which means ../logs
may point to some place that does not exist / the app user has no permissions to write to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the explanation via DM and in https://github.com/IQSS/dataverse/pull/10373/files#r1535665937, I understood better why this change is necessary.
As we should be thorough with this change, can you fix the missing occurrences @BenediktMeierUIT ?
Those would be in dataverse.authorization.AuthFilter
and dataverse.harvest.client.HarvesterServiceBean
.
That's right... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me now, thanks for the change! @pdurbin stage is yours 😄
@BenediktMeierUIT for next time, please do not use "develop" as the name of your branch. It make it hard to review and test as described in this issue: |
Tests are passing as as I mentioned above these changes are very similar to changes I made in pdurbin@8adb28d Merging. |
What this PR does / why we need it:
log file with a different instance root directory
Which issue(s) this PR closes:
Closes #10372
Special notes for your reviewer:
Suggestions on how to test this:
Does this PR introduce a user interface change? If mockups are available, please link/include them here:
Is there a release notes update needed for this change?:
Additional documentation: