Lqp1 opened a new pull request #414:
URL: https://github.com/apache/mesos/pull/414
When artifact size is smaller than expected, we want to reduce recorded
cache usage.
To do it, we actually compute the delta as an off_t (signed). If delta is
negative, we reclaim the extra space as it's not really used.
This attempt was failing because computed delta is negative,
and passed as Bytes to releaseSpace, which is unsigned. In
most cases, casting a negative value into an uint will
just give an unrelated value due to sign bit disappearing.
By passing the positive value to Bytes(), we have a safer cast.
To give more context, what we observe:
```
W1125 08:54:07.888011 10981 fetcher.cpp:643] URI download result for 'xxxxx'
is smaller than expected by 253B at: /var/opt/mesos/cache/xxxxxxxx
F1125 08:54:07.888082 10981 fetcher.cpp:1272] Check failed: bytes <= tally
Attempt to release more cache space than in use - requested:
18446744073709551364B, in use: 1910056052B
```
If you try
```
#include <stdio.h>
#include <stdint.h>
int main() {
off_t negative = -253;
printf("%lu\n", (uint64_t)(negative));
}
```
You'll see the same numbers match.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]