TIBCOSoftware / TIBCOSoftware/bwce-docker
Recent updates to the reduce startup time script breaks the setup when using BW_COMPONENT_JOB_FLOWLIMIT
Nobody has claimed this yet.
- Dominant language
- Shell
- Stars
- 22
- Forks
- 40
- PR merge metrics
- No merged PRs in 30d
Description
Introduced: https://github.com/TIBCOSoftware/bwce-docker/pull/69
When BW_COMPONENT_JOB_FLOWLIMIT is set, it runs this piece of code:
if [[ ${BW_COMPONENT_JOB_FLOWLIMIT} ]]; then
if [ -e ${appnodeConfigFile} ]; then
IFS=';' # space is set as delimiter
read -ra processConfigurationList <<< "${BW_COMPONENT_JOB_FLOWLIMIT}" # str is read into an array as tokens separated by IFS
for process in "${processConfigurationList[@]}"; do # access each element of array
echo "Setting flow limit for $process"
IFS=':' # space is set as delimiter
read -ra processConfiguration <<< "$process" # str is read into an array as tokens separated by IFS
printf '%s\n' "bw.application.job.flowlimit.$bwBundleAppName.${processConfiguration[0]}=${processConfiguration[1]}" >> $appnodeConfigFile
print_Debug "set bw.application.job.flowlimit.$bwBundleAppName.${processConfiguration[0]} to ${processConfiguration[1]}"
done
fi
fi
The problem is that it changes the IFS for all futher processing. As result
$JAVA_HOME/bin/java $BW_OPTS -cp `echo $BWCE_HOME/tibco.home/bw*/*/system/shared/com.tibco.bwce.profile.resolver_*.jar`:`echo $BWCE_HOME/tibco.home/bw*/*/system/shared/com.tibco.security.tibcrypt_*.jar`:`echo $BWCE_HOME/tibco.home/bw*/*/system/shared/com.tibco.tpcl.com.fasterxml.jackson_*`/*:`echo $BWCE_HOME/tibco.home/bw*/*/system/shared/com.tibco.bw.tpcl.encryption.util_*`/lib/*:`echo $BWCE_HOME/tibco.home/bw*/*/system/shared/com.tibco.bw.tpcl.org.codehaus.jettison_*`/*:`echo $BWCE_HOME/tibco.home/bw*/*/system/shared/com.tibco.tpcl.logback_*`/*:$BWCE_HOME:$JAVA_HOME/lib -DBWCE_APP_NAME=$bwBundleAppName com.tibco.bwce.profile.resolver.Resolver 1>/dev/null 2>&1
ends up splitted incorrectly and failes with error(only if you remove 1>/dev/null 2>&1 from the end, otherwise startup fails with no error message):
Could not find or load main class --add-opens java.management.sun.management=ALL-UNNAMED --add-opens=java.base.jdk.internal.loader=ALL-UNNAMED --add-opens java.base.java.lang=ALL-UNNAMED --add-opens java.base.java.lang.reflect=ALL-UNNAMED --add-opens java.naming.com.sun.jndi.ldap=ALL-UNNAMED --add-exports java.base.sun.security.ssl=ALL-UNNAMED --add-exports java.base.com.sun.crypto.provider=ALL-UNNAMED --add-exports java.management.com.sun.jmx.mbeanserver=ALL-UNNAMED
To reproduce simply set BW_COMPONENT_JOB_FLOWLIMIT env to non empty string.
BTW, why did you make all stdout and stderr silent(1>/dev/null 2>&1)? It is just harder to debug if something goes wrong as in this case.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the startup-time shell script containing the BW_COMPONENT_JOB_FLOWLIMIT block and reproduce the issue with that environment variable set. Check how the IFS change affects the later Java command and verify that startup completes correctly without incorrectly splitting its arguments; also inspect whether the silent output redirection affects diagnosing failures.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, shell
- Domain
- devops
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100