Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As my comment below, I'm not sure that hiding the nullpointer is the right approach. When calling getCurrentRequestedMips we basically assume that the Vm has been placed, hence getHost() shouldn't be null. I believe that the issue to be fixed is more intricate than this...

Copy link
Contributor Author

@Astabol Astabol Aug 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it is not fixing the root cause. If anyone called this from another example might get the same issue. I will look into it. Thank You

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your time!

Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ public LinkedHashSet<Integer> getHddsIds() {

@Override
public List<Double> getCurrentRequestedMips() {
if (getHost().getGuestScheduler() instanceof VmSchedulerMapVmsToPes<?> scheduler) {
if (getHost() != null && getHost().getGuestScheduler() instanceof VmSchedulerMapVmsToPes<?> scheduler) {

List<Double> currentRequestedMips = getCloudletScheduler().getCurrentRequestedMips();
if (isBeingInstantiated()) {
Expand Down
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this required for issue #205? I'd rather not touch the base simulation engine: I'm pretty sure that we want the simulator to fail if getIncomingEvents() is null-pointer, rather than "hiding" it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. I understand.

Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,9 @@ private static void dispatchEvent(SimEvent e) {
waitPredicates.remove(dstId);
}
}
destEnt.getIncomingEvents().add(e);
if(destEnt.getIncomingEvents() != null) {
destEnt.getIncomingEvents().add(e);
}
}
case SimEvent.HOLD_DONE -> entities.get(srcId).setState(SimEntity.EntityStatus.RUNNABLE);
default -> {
Expand Down