sqenvcom.sh. Our CLASSPATH is too big.

Bug #1437384 reported by Guy Groulx
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Trafodion
New
High
Sandhya Sundaresan

Bug Description

sqenvcom.sh sets up CLASSPATH for trafodion.

With HDP2.2, this CLASSPATH is huge. On one of our system, echo $CLASSPATH | wc -l return > 13000 bytes.
I believe java/Linux truncates these variables when it's too big.
Since going to HDP 2.2, we've been hit with "class not found" error eventhough the jar is in CLASSPATH.

http://stackoverflow.com/questions/1237093/using-wildcard-for-classpath explains that we can use wildcards in CLASSPATH to reduce it.

Rules:
Use * and not *.jar. Java assumes that * in classpath are for *.jar
When using export CLASSPATH use quotes so that * is not expanded. EG: export CLASSPATH=”/usr/hdp/current/hadoop-client/lib/*:${CLASSPATH}

We need to modify our sqenvcom.sh to use wildcards instead of putting individual jar.

Tags: sql-general
Revision history for this message
Alice Chen (alchen) wrote :

Not a Trafodion infrastructure bug. Moving to sql-general category.

tags: added: sql-general
removed: infrastructure
Revision history for this message
Steve Varnau (steve-varnau) wrote :

The limit should be the total command length, viewable from "getconf ARG_MAX", which seems to be 2MB on RedHat/CentOS. So, 13,000 bytes should not be getting truncated at all.

Agreed that the PATH length can and should be cleaned up. But the results would have to be well tested, as the implications of changing the classpath may be subtle.

Revision history for this message
Steve Varnau (steve-varnau) wrote :

I should say CLASSPATH length. The sqenvcom.sh file does too much manipulation of CLASSPATH to be easily changed, but when it is adding every jar file in a directory, it should probably just use dir/* instead.

Changed in trafodion:
assignee: nobody → Sandhya Sundaresan (sandhya-sundaresan)
milestone: none → r1.1
Changed in trafodion:
milestone: r1.1 → r2.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.