Skip to content

Commit a0ce525

Browse files
committed
opal hotel: only delete events that have not yet fired
The opal_hotel_checkout() function can be called manually or it can be invoked by the eviction callback. When it is invoked by the eviction callback, we do not want to opal_event_del() the eviction callback.
1 parent ac34c0e commit a0ce525

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

opal/class/opal_hotel.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2012-2013 Cisco Systems, Inc. All rights reserved.
2+
* Copyright (c) 2012-2016 Cisco Systems, Inc. All rights reserved.
33
* Copyright (c) 2012 Los Alamos National Security, LLC. All rights reserved
44
* Copyright (c) 2015 Intel, Inc. All rights reserved.
55
* $COPYRIGHT$
@@ -245,7 +245,11 @@ static inline void opal_hotel_checkout(opal_hotel_t *hotel, int room_num)
245245
room = &(hotel->rooms[room_num]);
246246
if (OPAL_LIKELY(NULL != room->occupant)) {
247247
room->occupant = NULL;
248-
if (NULL != hotel->evbase) {
248+
/* Only delete the eviction event if it has not already fired.
249+
Specifically: don't delete the event if it was invoked by
250+
the eviction timeout! */
251+
if (NULL != hotel->evbase &&
252+
opal_event_evtimer_pending(&room->eviction_timer_event, NULL)) {
249253
opal_event_del(&(room->eviction_timer_event));
250254
}
251255
hotel->last_unoccupied_room++;

0 commit comments

Comments
 (0)