Skip to content

Fixes #546: expectedFreePes overflow when cloudlet requires more PEs than available#547

Merged
manoelcampos merged 3 commits into
cloudsimplus:masterfrom
tgasla:bugfix-expected-free-pes
Apr 18, 2026
Merged

Fixes #546: expectedFreePes overflow when cloudlet requires more PEs than available#547
manoelcampos merged 3 commits into
cloudsimplus:masterfrom
tgasla:bugfix-expected-free-pes

Conversation

@tgasla
Copy link
Copy Markdown
Contributor

@tgasla tgasla commented Apr 17, 2026

Bug: When a cloudlet requires more PEs than the VM has, removeExpectedFreePesNumber clamps to 0, but addExpectedFreePesNumber adds back the full cloudlet PEs on completion, causing expectedFreePes to exceed totalPES.

See #546 for more information on this bug

Fix: Added upper bound clamp in VmAbstract.setExpectedFreePesNumber():

this.expectedFreePesNumber = Math.max(Math.min(expectedFreePes, getPesNumber()), 0);

@codacy-production
Copy link
Copy Markdown

codacy-production Bot commented Apr 17, 2026

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 2 duplication

Metric Results
Complexity 0
Duplication 2

View in Codacy

TIP This summary will be updated as you push new changes. Give us feedback

@manoelcampos manoelcampos force-pushed the bugfix-expected-free-pes branch from 5d4ae4d to 9d56448 Compare April 18, 2026 13:51
@manoelcampos manoelcampos force-pushed the bugfix-expected-free-pes branch from 9d56448 to b285390 Compare April 18, 2026 14:14
@manoelcampos manoelcampos merged commit 8b28a1c into cloudsimplus:master Apr 18, 2026
1 check passed
@manoelcampos manoelcampos self-requested a review April 18, 2026 14:25
@manoelcampos
Copy link
Copy Markdown
Collaborator

Thanks @tgasla. Great work.

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.

2 participants