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

Unify jvm memory settings validation & improve upload error message #2111

Merged
merged 1 commit into from Feb 27, 2019

Conversation

juhoautio
Copy link
Collaborator

Users shouldn't need to go view Azkaban source to find out why project upload failed in this kind of a case (from azkaban mailing list):

I am trying to upload a zip project file and getting this error, could not figure out the reason.

Users were getting java heap space error very often and by mistake while trying to solve it I have introduced the "job.max.Xmx=" twice in azkaban.properties, one of them empty.

Installation Failed.
For input string: "" 

2019/01/24 13:25:02.852 -0300 INFO [ProjectManagerServlet] [Azkaban] Upload: reference of project test_project_for_delete is 101056896
2019/01/24 13:25:02.853 -0300 INFO [ProjectManagerServlet] [Azkaban] Uploading file lte.zip
2019/01/24 13:25:02.853 -0300 INFO [AzkabanProjectLoader] [Azkaban] Uploading files to test_project_for_delete
2019/01/24 13:25:02.864 -0300 WARN [XmlValidatorManager] [Azkaban] Validator directory validators does not exist or is not a directory.
2019/01/24 13:25:02.865 -0300 WARN [XmlValidatorManager] [Azkaban] Azkaban properties file does not contain the key project.validators.xml.file
2019/01/24 13:25:02.865 -0300 INFO [AzkabanProjectLoader] [Azkaban] Validating project lte.zip using the registered validators []
2019/01/24 13:25:02.875 -0300 INFO [ProjectManagerServlet] [Azkaban] Installation Failed.
java.lang.NumberFormatException: For input string: ""
        at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
        at java.base/java.lang.Long.parseLong(Long.java:702)
        at java.base/java.lang.Long.parseLong(Long.java:817)
        at azkaban.utils.Utils.parseMemString(Utils.java:453)
        at azkaban.project.FlowLoaderUtils.checkJobProperties(FlowLoaderUtils.java:260)
        at azkaban.project.DirectoryFlowLoader.loadProjectFlow(DirectoryFlowLoader.java:142)
        at azkaban.project.AzkabanProjectLoader.uploadProject(AzkabanProjectLoader.java:105)
        at azkaban.project.ProjectManager.uploadProject(ProjectManager.java:506)
        at azkaban.webapp.servlet.ProjectManagerServlet.ajaxHandleUpload(ProjectManagerServlet.java:1753)
        at azkaban.webapp.servlet.ProjectManagerServlet.handleUpload(ProjectManagerServlet.java:1836)
        at azkaban.webapp.servlet.ProjectManagerServlet.handleMultiformPost(ProjectManagerServlet.java:201)
        at azkaban.webapp.servlet.LoginAbstractAzkabanServlet.doPost(LoginAbstractAzkabanServlet.java:311)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
        at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
        at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:401)
        at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
        at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
        at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
        at org.mortbay.jetty.Server.handle(Server.java:326)
        at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
        at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:945)
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
        at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
        at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
2019/01/24 13:25:02.877 -0300 INFO [ProjectManagerServlet] [Azkaban] Upload: project test_project_for_delete version is 0, reference is 101056896
2019/01/24 13:25:03.281 -0300 INFO [LoginAbstractAzkabanServlet] [Azkaban] 10.245.221.148 username "GET /manager project=test_project_for_delete HTTP/1.1" browser

@codecov
Copy link

codecov bot commented Jan 25, 2019

Codecov Report

Merging #2111 into master will increase coverage by 0.11%.
The diff coverage is 64%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2111      +/-   ##
============================================
+ Coverage     33.58%   33.69%   +0.11%     
- Complexity     2774     2782       +8     
============================================
  Files           418      419       +1     
  Lines         29782    29789       +7     
  Branches       3779     3780       +1     
============================================
+ Hits          10001    10037      +36     
+ Misses        18887    18855      -32     
- Partials        894      897       +3
Impacted Files Coverage Δ Complexity Δ
az-core/src/main/java/azkaban/utils/Utils.java 44.97% <ø> (-0.53%) 44 <0> (ø)
.../main/java/azkaban/jobExecutor/JavaProcessJob.java 50.72% <0%> (+2.77%) 13 <0> (ø) ⬇️
...core/src/main/java/azkaban/utils/MemConfValue.java 100% <100%> (ø) 7 <7> (?)
...src/main/java/azkaban/project/FlowLoaderUtils.java 63.41% <50%> (-0.82%) 23 <0> (ø)
...erver/src/main/java/azkaban/execapp/JobRunner.java 70.02% <0%> (-0.22%) 85% <0%> (-2%)
...main/java/azkaban/executor/ExecutableFlowBase.java 83.33% <0%> (+1.14%) 48% <0%> (+1%) ⬆️
...n/java/azkaban/jobExecutor/AbstractProcessJob.java 60.71% <0%> (+3.57%) 13% <0%> (ø) ⬇️
...c/main/java/azkaban/execapp/event/FlowWatcher.java 89.58% <0%> (+4.16%) 17% <0%> (+1%) ⬆️
...src/main/java/azkaban/jobExecutor/AbstractJob.java 37.93% <0%> (+6.89%) 5% <0%> (+1%) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 28a27f3...b012741. Read the comment docs.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 4331

  • 17 of 25 (68.0%) changed or added relevant lines in 3 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.1%) to 36.823%

Changes Missing Coverage Covered Lines Changed/Added Lines %
azkaban-common/src/main/java/azkaban/project/FlowLoaderUtils.java 4 6 66.67%
azkaban-common/src/main/java/azkaban/jobExecutor/JavaProcessJob.java 0 6 0.0%
Files with Coverage Reduction New Missed Lines %
azkaban-exec-server/src/main/java/azkaban/execapp/JobRunner.java 2 76.87%
Totals Coverage Status
Change from base Build 4330: 0.1%
Covered Lines: 10917
Relevant Lines: 29647

💛 - Coveralls

@juhoautio
Copy link
Collaborator Author

@burgerkingeater are you able to review this, too?

@burgerkingeater
Copy link
Contributor

@juhoautio can you help me better understand this PR? Why would it help the described issue?

@juhoautio
Copy link
Collaborator Author

If there's an empty value like "job.max.Xmx=" in some properties, upload fails with this error:

Installation Failed.
For input string: ""

So it doesn't help much because it doesn't even tell the name of the problematic property.

This PR improves it by returning a better error message ie. one that includes the property name.

Currently user would need to grab the stack trace, get azkaban source code, and find the line, to know which property caused the upload failure.

import com.google.common.base.Preconditions;
import org.apache.commons.lang.StringUtils;

public class MemConfValue {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be applied to other properties? If so, can we make this universal?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How? I guess these are the only properties that azkaban parses expecting this pattern.

@juhoautio
Copy link
Collaborator Author

@burgerkingeater ..good to merge?

@burgerkingeater burgerkingeater merged commit 2273b77 into azkaban:master Feb 27, 2019
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

Successfully merging this pull request may close these issues.

None yet

3 participants