jefferson1 Posted September 12 Report Posted September 12 jenkins is deploying code to nfs mount , lets say at 10:00 am script starts the copy of file immediately from mount to tom cat webapps on destination servers for some servers, the war file is placed there after 10 mins (this is where the issue is). In some cases when the dev tests the code they are seeing old code. ela troubleshoot cheyali Quote
JingBang Posted September 12 Report Posted September 12 If you are looking to verify if the latest code is deployed, add a start up log with the current version of your packaged code. The version could just be a snapshot increment or one based on a timestamp. Quote
DallasKarreBaluu Posted September 12 Report Posted September 12 5 minutes ago, jefferson1 said: jenkins is deploying code to nfs mount , lets say at 10:00 am script starts the copy of file immediately from mount to tom cat webapps on destination servers for some servers, the war file is placed there after 10 mins (this is where the issue is). In some cases when the dev tests the code they are seeing old code. ela troubleshoot cheyali simple problem anna wait for offshore hours and assign and ask him to complete in 1 hour. 1 Quote
HEROO Posted September 12 Report Posted September 12 13 minutes ago, jefferson1 said: jenkins is deploying code to nfs mount , lets say at 10:00 am script starts the copy of file immediately from mount to tom cat webapps on destination servers for some servers, the war file is placed there after 10 mins (this is where the issue is). In some cases when the dev tests the code they are seeing old code. ela troubleshoot cheyali Submit ticket to jenkins / devops team look into it Quote
jefferson1 Posted September 12 Author Report Posted September 12 24 minutes ago, HEROO said: Submit ticket to jenkins / devops team look into it jenkins is sending file at the right time...issue is after that only Quote
jefferson1 Posted September 12 Author Report Posted September 12 35 minutes ago, JingBang said: If you are looking to verify if the latest code is deployed, add a start up log with the current version of your packaged code. The version could just be a snapshot increment or one based on a timestamp. one quesition, since the code is on several servers, how to identify which server it went to? Quote
JerseyBidda Posted September 12 Report Posted September 12 34 minutes ago, jefferson1 said: 35 minutes ago, jefferson1 said: one quesition, since the code is on several servers, how to identify which server it went to? Write a script to read server logs in specific environment and trigger alerts. Jenkins nundi ela track cheyalo aithe idea ledu, we use ELASTIC stack for the same monitoring purpose! Quote
jefferson1 Posted September 17 Author Report Posted September 17 tomcat is exploding the war file correctly, Server paina code kanipisthundi also on browser when we run the test, we are not seeing the kotha code changes Quote
DallasKarreBaluu Posted September 17 Report Posted September 17 6 minutes ago, jefferson1 said: tomcat is exploding the war file correctly, Server paina code kanipisthundi also on browser when we run the test, we are not seeing the kotha code changes new upgrade chesi untaru anna Please note that signing in with a Display Name has been removed in next upgrade. Email addresses must be used instead to login. Quote
jefferson1 Posted September 17 Author Report Posted September 17 9 minutes ago, DallasKarreBaluu said: new upgrade chesi untaru anna Please note that signing in with a Display Name has been removed in next upgrade. Email addresses must be used instead to login. its installed in 2022 bro i checked...no changes were made 1 Quote
DallasKarreBaluu Posted September 18 Report Posted September 18 12 minutes ago, jefferson1 said: its installed in 2022 bro i checked...no changes were made @psycopk nani babu help on the issue Quote
Konebhar6 Posted September 18 Report Posted September 18 14 minutes ago, jefferson1 said: its installed in 2022 bro i checked...no changes were made Have you tried chatGPT or Claude? It will give you best answer Quote
jefferson1 Posted September 18 Author Report Posted September 18 1 minute ago, Konebhar6 said: Have you tried chatGPT or Claude? It will give you best answer Every thing is asking to restart tomcat bro. with out restarting the tomcat, i am trying to see what i can do server paina other code undi, as this will affect other also Quote
Konebhar6 Posted September 18 Report Posted September 18 On 9/11/2025 at 6:15 PM, jefferson1 said: jenkins is deploying code to nfs mount , lets say at 10:00 am script starts the copy of file immediately from mount to tom cat webapps on destination servers for some servers, the war file is placed there after 10 mins (this is where the issue is). In some cases when the dev tests the code they are seeing old code. ela troubleshoot cheyali You’re hitting a classic race condition + NFS caching issue: Jenkins drops a WAR to an NFS export at ~10:00. Your copy script starts immediately. Some clients still “see” the old file (NFS attribute caching / propagation), or the WAR is still being written when the copy begins. Tomcat may also be serving an exploded old webapp directory even if a new WAR was copied. Here’s a robust, low-drama deployment pattern you can implement today. 1) Publish atomically to NFS (producer side: Jenkins) Never let consumers read a file that’s still being written. # Jenkins stage: publish to NFS ART=app-$(date +%Y%m%d-%H%M).war NFS=/nfs/releases/myapp TMP="$NFS/$ART.part" FINAL="$NFS/$ART" SHA="$FINAL.sha256" READY="$FINAL.ready" # write to a temp name on the SAME filesystem, then atomic rename cp target/app.war "$TMP" && sync mv "$TMP" "$FINAL" # produce checksum + "ready" marker AFTER the atomic rename sha256sum "$FINAL" > "$SHA" touch "$READY" Notes: Writing to *.part then mv on the same NFS volume is atomic. Consumers should only react to *.ready. The checksum gives consumers a way to validate what they copy. 2) Consume safely (destination servers) Only copy once the artifact is fully ready, then make your replace atomic too. APP=myapp CATALINA=/opt/tomcat NFS=/nfs/releases/myapp # If you don’t know the exact name, pick the newest ready file: ART=$(ls -1t "$NFS"/app-*.war.ready | head -1 | sed 's/.ready$//') # Wait for ready marker and stable size READY="$ART.ready" SHA="$ART.sha256" while [ ! -f "$READY" ]; do sleep 2; done # Double-check file size stability prev=-1 while true; do sz=$(stat -c%s "$ART") [ "$sz" = "$prev" ] && break prev=$sz sleep 2 done # Verify checksum ( cd "$(dirname "$ART")" && sha256sum -c "$(basename "$SHA")" ) || { echo "Checksum mismatch—abort"; exit 1; } # Copy WAR locally via a temp name, then atomic move rsync -a --delay-updates "$ART" "$CATALINA/webapps/${APP}.war.tmp" mv "$CATALINA/webapps/${APP}.war.tmp" "$CATALINA/webapps/${APP}.war" # Ensure no stale exploded directory remains rm -rf "$CATALINA/webapps/${APP}" # Bounce or use Tomcat Manager for a clean reload # systemctl restart tomcat Why this works: You never read while Jenkins is writing. You validate integrity (checksum). You avoid partial/locked reads and ensure your own replacement is atomic. You clear the exploded directory so Tomcat can’t mix old/new files. 3) Tame NFS caching (optional but helpful) If you must read via NFS, reduce attribute caching on consumers: Mount options: actimeo=1 (or tune acregmin/acregmax/acdirmin/acdirmax to small values). Avoid noac unless absolutely necessary (big performance hit). Ensure server export isn’t async if you’ve seen write visibility delays (trade-off: slower writes, more safety). 4) Even better: avoid NFS as the distribution bus NFS is fine for shared state, not ideal for release fan-out. Two solid alternatives: Pull from an artifact repository (Artifactory/Nexus/S3) with a versioned URL + checksum; servers fetch when Jenkins posts a webhook/message. Push with rsync/scp/Ansible from Jenkins directly to each server; no caching layer in the middle. 5) Tomcat specifics to prevent “old code” showing If Tomcat unpacks WARs, delete the exploded folder before (re)start as shown above. Consider versioned/parallel deployment: drop myapp##20250917-1000.war. Tomcat can run parallel versions and switch cleanly—no stale leftovers. Clear $CATALINA_BASE/work/ on redeploys if you see persisted JSP/class artifacts. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.