Home › DevOps › AutoSys Virtual Resources: Run Only One of Two Jobs at a Time (RESWAIT, FREE=Y vs FREE=A)
Intermediate 3 min · November 09, 2026

AutoSys Virtual Resources: Run Only One of Two Jobs at a Time (RESWAIT, FREE=Y vs FREE=A)

Use an AutoSys renewable resource with one unit as a lock so only one job runs at a time.

N
Naren Founder & Principal Engineer

20+ years shipping production infrastructure and CI/CD at scale. Everything here is grounded in real deployments.

Follow
✓ Production
production tested
November 09, 2026
last updated
2,128
articles · all by Naren
Before you start⏱ 6 min
  • ✓AutoSys JIL basics
 ● Production Incident 🔎 Debug Guide
⚡Quick Answer
  • Define: insert_resource: GL_LOCK / res_type: R / amount: 1
  • On each job: resources: (GL_LOCK, QUANTITY=1, FREE=A)
  • Only one job holds the unit; the other waits in RESWAIT.
  • FREE=Y (default) returns the unit on success only. After a failure it's held until released manually.
  • FREE=A always returns it. FREE=N never does automatically.
  • A job waiting in RESWAIT also blocks lower-priority jobs that ask for the same resource.
✦ Definition~90s read
What is AutoSys Resources?

A virtual resource is a named pool of units in AutoSys. A renewable resource (res_type: R) is borrowed: a job takes units when it starts and gives them back when it ends. With one unit and two jobs asking for it, only one can run; the other waits in RESWAIT. The job's FREE setting decides when units are returned.

★
It's the single key to a shared room.
Plain-English First

It's the single key to a shared room. Whoever has the key goes in; the other waits outside. FREE=Y means you only hand the key back if things went well. If you fail, you walk off with it.

Two jobs must never update the same ledger at once. A resource with one unit makes that rule part of the schedule. The trap is what happens to the unit when a job fails.

Define the Resource

A renewable resource with amount 1 acts as a lock.

resource.jilJIL
1
2
3
insert_resource: GL_LOCK
res_type: R
amount: 1
🎯 Key Takeaway
res_type: R, amount: 1.

Ask for It in Each Job

Each job requests one unit. The first takes it; the next waits in RESWAIT until it comes back.

jobs.jilJIL
1
2
3
4
5
update_job: GL_POST_US
resources: (GL_LOCK, QUANTITY=1, FREE=A)

update_job: GL_POST_EU
resources: (GL_LOCK, QUANTITY=1, FREE=A)
🎯 Key Takeaway
Only one runs at a time.

FREE=Y, A, N

FREE=Y returns units when the job succeeds (the default). FREE=A returns them whatever the outcome. FREE=N never returns them automatically. For a lock, use A.

free.txtTEXT
1
2
3
FREE=Y  release on success only (default)
FREE=A  always release
FREE=N  never release automatically
⚠ Held units
With FREE=Y, a failed job keeps its units until they're released manually.
🎯 Key Takeaway
FREE=A for locks.
● Production incidentPOST-MORTEMseverity: high

The Failed Job That Kept the Lock

Symptom
autorep showed GL_POST_US in FA and GL_POST_EU in RW for hours.
Assumption
The team thought the resource was released when the first job ended.
Root cause
Both jobs used resources: (GL_LOCK, QUANTITY=1, FREE=Y). FREE=Y releases on success only; the failed job kept the unit.
Fix
Released the unit, then changed both jobs to FREE=A.
Key lesson
  • FREE=Y holds units after failure.
  • Use FREE=A for locks.
  • Alert on long RESWAIT.
Production debug guideWhy is it waiting?2 entries
Symptom · 01
Job in RESWAIT
→
Fix
Find which job holds the resource's units; check whether it failed with FREE=Y.
Symptom · 02
Several jobs waiting
→
Fix
A waiting job blocks lower-priority jobs asking for the same resource.
⚙ Quick Reference
3 commands from this guide
FileCommand / CodePurpose
resource.jilinsert_resource: GL_LOCKDefine the Resource
jobs.jilupdate_job: GL_POST_USAsk for It in Each Job
free.txtFREE=Y release on success only (default)FREE=Y, A, N

Key takeaways

1
Renewable resource, amount 1 = lock.
2
Waiting job shows RESWAIT.
3
FREE=Y holds after failure.
4
Use FREE=A.

Common mistakes to avoid

2 patterns
×

FREE=Y on a lock

Symptom
One failure blocks the other job all night.
Fix
FREE=A.
×

Depletable instead of renewable

Symptom
Units are used up permanently.
Fix
res_type: R for locks.
INTERVIEW PREP · PRACTICE MODE

Interview Questions on This Topic

Q01SENIOR
How do you stop two AutoSys jobs running at the same time?
Q02JUNIOR
What is RESWAIT?
Q01 of 02SENIOR

How do you stop two AutoSys jobs running at the same time?

ANSWER
A renewable resource with one unit, requested by both jobs.
FAQ · 2 QUESTIONS

Frequently Asked Questions

01
How do I use a resource to run only one of two AutoSys jobs?
02
Why is my AutoSys job stuck in RESWAIT?
COMPLETE GUIDE
The Complete AutoSys Workload Automation Guide for Engineers →

JIL syntax, sendevent, autorep, box jobs, file watchers, scheduling, HA, security, cloud workload automation, and 22 interview questions — the definitive AutoSys reference for production engineers.

N
Naren Founder & Principal Engineer

20+ years shipping production infrastructure and CI/CD at scale. Everything here is grounded in real deployments.

Follow
✓ Verified
production tested
November 09, 2026
last updated
2,128
articles · all by Naren
🔥

That's AutoSys. Mark it forged?

3 min read · try the examples if you haven't

←
Previous
AutoSys: First Tuesday of the Month (Extended Calendars)
46 / 49 · AutoSys
Next
AutoSys envvars and profile
→