Closed choksi81 closed 7 years ago
Author: albert
Fixed in r7174. All of the unit tests that use getresources
and succeeded before still work; no additional ones fail.
Author: leonwlaw This fix broke vessel joining, as when the resourcedicts are added together, they are checked if they are floats. Of course, ints break that :)
https://seattle.poly.edu/browser/seattle/branches/repy_v2/repy/resourcemanipulation.py?rev=7147#L339
Proposed fix is to change the condition to be:
if type(retdict[not in [float, int](resource]))
Author: monzum Additional fix for this in r7166. resourcemanipulation.py was still reaching this error: https://seattle.poly.edu/browser/seattle/branches/repy_v2/repy/resourcemanipulation.py?rev=7147#L404
Closing this issue, it was fixed via ca83de7de7f2a71c97f692d7c4c14e5fe253b9d2 a while ago.
resourcemanipulation.py is responsible for reading in and parsing restrictions files, and making the contents available to
nanny
. It will however treat all resource values asfloats
, see here. This makes sense for things like consumption rates (cpu
,net
,loop
,disk
,random
), but it also converts port numbers, Bytes used on disk and in memory, and socket, file, and thread counts.This weird behavior is visible e.g. through
getresources
:If)), and use the correct numeric type accordingly.