You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Alexander Rojas <al...@mesosphere.io> on 2015/06/08 17:14:23 UTC
Re: Review Request 30032: Added support for cache control in
libprocess when dealing with static files.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/30032/
-----------------------------------------------------------
(Updated June 8, 2015, 5:14 p.m.)
Review request for mesos, Benjamin Hindman, Bernd Mathiske, Joerg Schad, Michael Park, and Till Toenshoff.
Changes
-------
rebased.
Bugs: mesos-708
https://issues.apache.org/jira/browse/mesos-708
Repository: mesos
Description
-------
When serving a static file, libprocess returns the header `Last-Modified` which is used by browsers to control Cache.
When a http request arrives containing the header `If-Modified-Since`, a response `304 Not Modified` is returned if the date in the request and the modification time (as returned by doing `stat` in the file) coincide.
Unit tests added.
Diffs (updated)
-----
3rdparty/libprocess/include/process/http.hpp 51a00f5cf6a84413c8ab73a4e62e1814e9af2339
3rdparty/libprocess/src/process.cpp aadd7bb0ae12b93336900c76d8d5aaa4421ea198
3rdparty/libprocess/src/tests/process_tests.cpp 0832c6266cea0fb6bdbd523921c1367959419af8
Diff: https://reviews.apache.org/r/30032/diff/
Testing
-------
make check
Thanks,
Alexander Rojas
Re: Review Request 30032: Added support for cache control in
libprocess when dealing with static files.
Posted by Mesos ReviewBot <re...@mesos.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/30032/#review87041
-----------------------------------------------------------
Patch looks great!
Reviews applied: [34703, 30032]
All tests passed.
- Mesos ReviewBot
On June 8, 2015, 3:14 p.m., Alexander Rojas wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/30032/
> -----------------------------------------------------------
>
> (Updated June 8, 2015, 3:14 p.m.)
>
>
> Review request for mesos, Benjamin Hindman, Bernd Mathiske, Joerg Schad, Michael Park, and Till Toenshoff.
>
>
> Bugs: mesos-708
> https://issues.apache.org/jira/browse/mesos-708
>
>
> Repository: mesos
>
>
> Description
> -------
>
> When serving a static file, libprocess returns the header `Last-Modified` which is used by browsers to control Cache.
> When a http request arrives containing the header `If-Modified-Since`, a response `304 Not Modified` is returned if the date in the request and the modification time (as returned by doing `stat` in the file) coincide.
> Unit tests added.
>
>
> Diffs
> -----
>
> 3rdparty/libprocess/include/process/http.hpp 51a00f5cf6a84413c8ab73a4e62e1814e9af2339
> 3rdparty/libprocess/src/process.cpp aadd7bb0ae12b93336900c76d8d5aaa4421ea198
> 3rdparty/libprocess/src/tests/process_tests.cpp 0832c6266cea0fb6bdbd523921c1367959419af8
>
> Diff: https://reviews.apache.org/r/30032/diff/
>
>
> Testing
> -------
>
> make check
>
>
> Thanks,
>
> Alexander Rojas
>
>
Re: Review Request 30032: Added support for cache control in
libprocess when dealing with static files.
Posted by Mesos ReviewBot <re...@mesos.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/30032/#review88198
-----------------------------------------------------------
Patch looks great!
Reviews applied: [34703, 30032]
All tests passed.
- Mesos ReviewBot
On June 17, 2015, 2:08 a.m., Alexander Rojas wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/30032/
> -----------------------------------------------------------
>
> (Updated June 17, 2015, 2:08 a.m.)
>
>
> Review request for mesos, Benjamin Hindman, Bernd Mathiske, Joerg Schad, Michael Park, and Till Toenshoff.
>
>
> Bugs: mesos-708
> https://issues.apache.org/jira/browse/mesos-708
>
>
> Repository: mesos
>
>
> Description
> -------
>
> When serving a static file, libprocess returns the header `Last-Modified` which is used by browsers to control Cache.
> When a http request arrives containing the header `If-Modified-Since`, a response `304 Not Modified` is returned if the date in the request and the modification time (as returned by doing `stat` in the file) coincide.
> Unit tests added.
>
>
> Diffs
> -----
>
> 3rdparty/libprocess/include/process/http.hpp e47cc7afbc8110759edf25a2dc05d09eda25c417
> 3rdparty/libprocess/src/process.cpp a67a3afdb30d23eb1b265b04ae662f64e874b6c6
> 3rdparty/libprocess/src/tests/process_tests.cpp 660af45e7fd45bdf5d43ad9aa54477fd94f87058
>
> Diff: https://reviews.apache.org/r/30032/diff/
>
>
> Testing
> -------
>
> make check
>
>
> Thanks,
>
> Alexander Rojas
>
>
Re: Review Request 30032: Added support for cache control in
libprocess when dealing with static files.
Posted by Alexander Rojas <al...@mesosphere.io>.
> On June 17, 2015, 4 p.m., Bernd Mathiske wrote:
> > 3rdparty/libprocess/src/process.cpp, line 2842
> > <https://reviews.apache.org/r/30032/diff/13/?file=986200#file986200line2842>
> >
> > Here we can output mtime.error().
This one is a bad place since here `strftime` failed, which is unrelated to `mtime`. I did find a better place though.
> On June 17, 2015, 4 p.m., Bernd Mathiske wrote:
> > 3rdparty/libprocess/src/process.cpp, line 2861
> > <https://reviews.apache.org/r/30032/diff/13/?file=986200#file986200line2861>
> >
> > No need to check mtime.isError(). It is actually a bit confusing all the explanations above.
I know the comment above is confusing, however it appears in all the `dispatch(proxy, &HttpProxy::enqueue, _, _)` in the file.
- Alexander
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/30032/#review88211
-----------------------------------------------------------
On June 17, 2015, 5:42 p.m., Alexander Rojas wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/30032/
> -----------------------------------------------------------
>
> (Updated June 17, 2015, 5:42 p.m.)
>
>
> Review request for mesos, Benjamin Hindman, Bernd Mathiske, Joerg Schad, Michael Park, and Till Toenshoff.
>
>
> Bugs: mesos-708
> https://issues.apache.org/jira/browse/mesos-708
>
>
> Repository: mesos
>
>
> Description
> -------
>
> When serving a static file, libprocess returns the header `Last-Modified` which is used by browsers to control Cache.
> When a http request arrives containing the header `If-Modified-Since`, a response `304 Not Modified` is returned if the date in the request and the modification time (as returned by doing `stat` in the file) coincide.
> Unit tests added.
>
>
> Diffs
> -----
>
> 3rdparty/libprocess/include/process/http.hpp e47cc7afbc8110759edf25a2dc05d09eda25c417
> 3rdparty/libprocess/src/process.cpp a67a3afdb30d23eb1b265b04ae662f64e874b6c6
> 3rdparty/libprocess/src/tests/process_tests.cpp 660af45e7fd45bdf5d43ad9aa54477fd94f87058
>
> Diff: https://reviews.apache.org/r/30032/diff/
>
>
> Testing
> -------
>
> make check
>
>
> Thanks,
>
> Alexander Rojas
>
>
Re: Review Request 30032: Added support for cache control in
libprocess when dealing with static files.
Posted by Bernd Mathiske <be...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/30032/#review88211
-----------------------------------------------------------
Well done! An very nice test code.
3rdparty/libprocess/src/process.cpp (line 2815)
<https://reviews.apache.org/r/30032/#comment140607>
Since this review depends on RR 34307 that introduces Path:mtime() you should be using it already!
3rdparty/libprocess/src/process.cpp (line 2817)
<https://reviews.apache.org/r/30032/#comment140605>
That the time could not be parsed is not the only conceivable cause of error. For whatever reason, the asset could be gone, for example. Better to propagate the error from systemMtime.error().
3rdparty/libprocess/src/process.cpp (line 2818)
<https://reviews.apache.org/r/30032/#comment140606>
If we used a conditional operator (?) expression instead, mtime could be const.
3rdparty/libprocess/src/process.cpp (line 2822)
<https://reviews.apache.org/r/30032/#comment140611>
s/hasn't/has not
Or delete the sentence if you handle the next issue as suggested.
3rdparty/libprocess/src/process.cpp (line 2823)
<https://reviews.apache.org/r/30032/#comment140613>
Suggestion to rephrase this:
"These conditions must hold to establish that the file has not been modified since its most recent access:
1. The If-Modified-Since' header must be present in the request.
2. The local modification time must be determined here.
3. That modification time must differ from the time provided by the above header.
An error is logged, but not propagated if any of this fails. Then the request simply proceeds as if the file had been modified."
3rdparty/libprocess/src/process.cpp (line 2826)
<https://reviews.apache.org/r/30032/#comment140610>
I'd move this line up before the comment.
3rdparty/libprocess/src/process.cpp (line 2838)
<https://reviews.apache.org/r/30032/#comment140614>
We could log if client == -1 happens.
3rdparty/libprocess/src/process.cpp (line 2842)
<https://reviews.apache.org/r/30032/#comment140609>
Here we can output mtime.error().
3rdparty/libprocess/src/process.cpp (line 2846)
<https://reviews.apache.org/r/30032/#comment140615>
Suggestion: "Provide the Last-Modified header to the client to facilitate its setting up a cache."
3rdparty/libprocess/src/process.cpp (line 2861)
<https://reviews.apache.org/r/30032/#comment140624>
No need to check mtime.isError(). It is actually a bit confusing all the explanations above.
3rdparty/libprocess/src/process.cpp (line 2862)
<https://reviews.apache.org/r/30032/#comment140625>
Delete this redundant comment.
3rdparty/libprocess/src/process.cpp (line 2862)
<https://reviews.apache.org/r/30032/#comment140626>
Delete this redundant comment.
3rdparty/libprocess/src/tests/process_tests.cpp (line 1734)
<https://reviews.apache.org/r/30032/#comment140628>
seconds
3rdparty/libprocess/src/tests/process_tests.cpp (line 1749)
<https://reviews.apache.org/r/30032/#comment140631>
s/Request/The request's modification
s/mismatch/does not match the
3rdparty/libprocess/src/tests/process_tests.cpp (line 1758)
<https://reviews.apache.org/r/30032/#comment140632>
See above.
- Bernd Mathiske
On June 16, 2015, 7:08 p.m., Alexander Rojas wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/30032/
> -----------------------------------------------------------
>
> (Updated June 16, 2015, 7:08 p.m.)
>
>
> Review request for mesos, Benjamin Hindman, Bernd Mathiske, Joerg Schad, Michael Park, and Till Toenshoff.
>
>
> Bugs: mesos-708
> https://issues.apache.org/jira/browse/mesos-708
>
>
> Repository: mesos
>
>
> Description
> -------
>
> When serving a static file, libprocess returns the header `Last-Modified` which is used by browsers to control Cache.
> When a http request arrives containing the header `If-Modified-Since`, a response `304 Not Modified` is returned if the date in the request and the modification time (as returned by doing `stat` in the file) coincide.
> Unit tests added.
>
>
> Diffs
> -----
>
> 3rdparty/libprocess/include/process/http.hpp e47cc7afbc8110759edf25a2dc05d09eda25c417
> 3rdparty/libprocess/src/process.cpp a67a3afdb30d23eb1b265b04ae662f64e874b6c6
> 3rdparty/libprocess/src/tests/process_tests.cpp 660af45e7fd45bdf5d43ad9aa54477fd94f87058
>
> Diff: https://reviews.apache.org/r/30032/diff/
>
>
> Testing
> -------
>
> make check
>
>
> Thanks,
>
> Alexander Rojas
>
>
Re: Review Request 30032: Added support for cache control in
libprocess when dealing with static files.
Posted by Bernd Mathiske <be...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/30032/#review90672
-----------------------------------------------------------
Ship it!
If/when RR 34703 ships first, please fix this TODO:
// TODO(arojas): Use Path.mtime() once it is available.
- Bernd Mathiske
On June 17, 2015, 8:42 a.m., Alexander Rojas wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/30032/
> -----------------------------------------------------------
>
> (Updated June 17, 2015, 8:42 a.m.)
>
>
> Review request for mesos, Benjamin Hindman, Bernd Mathiske, Joerg Schad, Michael Park, and Till Toenshoff.
>
>
> Bugs: mesos-708
> https://issues.apache.org/jira/browse/mesos-708
>
>
> Repository: mesos
>
>
> Description
> -------
>
> When serving a static file, libprocess returns the header `Last-Modified` which is used by browsers to control Cache.
> When a http request arrives containing the header `If-Modified-Since`, a response `304 Not Modified` is returned if the date in the request and the modification time (as returned by doing `stat` in the file) coincide.
> Unit tests added.
>
>
> Diffs
> -----
>
> 3rdparty/libprocess/include/process/http.hpp e47cc7afbc8110759edf25a2dc05d09eda25c417
> 3rdparty/libprocess/src/process.cpp a67a3afdb30d23eb1b265b04ae662f64e874b6c6
> 3rdparty/libprocess/src/tests/process_tests.cpp 660af45e7fd45bdf5d43ad9aa54477fd94f87058
>
> Diff: https://reviews.apache.org/r/30032/diff/
>
>
> Testing
> -------
>
> make check
>
>
> Thanks,
>
> Alexander Rojas
>
>
Re: Review Request 30032: Added support for cache control in
libprocess when dealing with static files.
Posted by Till Toenshoff <to...@me.com>.
> On July 9, 2015, 7:19 p.m., Ben Mahler wrote:
> >
Thanks for looking into this Ben - we will shortly propose a fix for the current test break on Ubuntu and also most of these nits.
- Till
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/30032/#review91149
-----------------------------------------------------------
On June 17, 2015, 3:42 p.m., Alexander Rojas wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/30032/
> -----------------------------------------------------------
>
> (Updated June 17, 2015, 3:42 p.m.)
>
>
> Review request for mesos, Benjamin Hindman, Bernd Mathiske, Joerg Schad, Michael Park, and Till Toenshoff.
>
>
> Bugs: mesos-708
> https://issues.apache.org/jira/browse/mesos-708
>
>
> Repository: mesos
>
>
> Description
> -------
>
> When serving a static file, libprocess returns the header `Last-Modified` which is used by browsers to control Cache.
> When a http request arrives containing the header `If-Modified-Since`, a response `304 Not Modified` is returned if the date in the request and the modification time (as returned by doing `stat` in the file) coincide.
> Unit tests added.
>
>
> Diffs
> -----
>
> 3rdparty/libprocess/include/process/http.hpp e47cc7afbc8110759edf25a2dc05d09eda25c417
> 3rdparty/libprocess/src/process.cpp a67a3afdb30d23eb1b265b04ae662f64e874b6c6
> 3rdparty/libprocess/src/tests/process_tests.cpp 660af45e7fd45bdf5d43ad9aa54477fd94f87058
>
> Diff: https://reviews.apache.org/r/30032/diff/
>
>
> Testing
> -------
>
> make check
>
>
> Thanks,
>
> Alexander Rojas
>
>
Re: Review Request 30032: Added support for cache control in
libprocess when dealing with static files.
Posted by Till Toenshoff <to...@me.com>.
> On July 9, 2015, 7:19 p.m., Ben Mahler wrote:
> >
>
> Till Toenshoff wrote:
> Thanks for looking into this Ben - we will shortly propose a fix for the current test break on Ubuntu and also most of these nits.
We decided to revert that commit instead for now until we can thorroughly fix this RR.
> On July 9, 2015, 7:19 p.m., Ben Mahler wrote:
> > 3rdparty/libprocess/src/process.cpp, lines 2815-2819
> > <https://reviews.apache.org/r/30032/diff/14/?file=986489#file986489line2815>
> >
> > Any reason we didn't convert os::stat::mtime to return a Time?
> >
> > The only other user of os::stat::mtime does the same messy conversion:
> >
> > ```
> > Future<Nothing> Slave::garbageCollect(const string& path)
> > {
> > Try<long> mtime = os::stat::mtime(path);
> > if (mtime.isError()) {
> > LOG(ERROR) << "Failed to find the mtime of '" << path
> > << "': " << mtime.error();
> > return Failure(mtime.error());
> > }
> >
> > // It is unsafe for testing to use unix time directly, we must use
> > // Time::create to convert into a Time object that reflects the
> > // possibly advanced state of the libprocess Clock.
> > Try<Time> time = Time::create(mtime.get());
> > CHECK_SOME(time);
> > ```
One reason could be that os::stat::mtime lives in stout whereas Time lives in libprocess, no?
- Till
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/30032/#review91149
-----------------------------------------------------------
On June 17, 2015, 3:42 p.m., Alexander Rojas wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/30032/
> -----------------------------------------------------------
>
> (Updated June 17, 2015, 3:42 p.m.)
>
>
> Review request for mesos, Benjamin Hindman, Bernd Mathiske, Joerg Schad, Michael Park, and Till Toenshoff.
>
>
> Bugs: mesos-708
> https://issues.apache.org/jira/browse/mesos-708
>
>
> Repository: mesos
>
>
> Description
> -------
>
> When serving a static file, libprocess returns the header `Last-Modified` which is used by browsers to control Cache.
> When a http request arrives containing the header `If-Modified-Since`, a response `304 Not Modified` is returned if the date in the request and the modification time (as returned by doing `stat` in the file) coincide.
> Unit tests added.
>
>
> Diffs
> -----
>
> 3rdparty/libprocess/include/process/http.hpp e47cc7afbc8110759edf25a2dc05d09eda25c417
> 3rdparty/libprocess/src/process.cpp a67a3afdb30d23eb1b265b04ae662f64e874b6c6
> 3rdparty/libprocess/src/tests/process_tests.cpp 660af45e7fd45bdf5d43ad9aa54477fd94f87058
>
> Diff: https://reviews.apache.org/r/30032/diff/
>
>
> Testing
> -------
>
> make check
>
>
> Thanks,
>
> Alexander Rojas
>
>
Re: Review Request 30032: Added support for cache control in
libprocess when dealing with static files.
Posted by Alexander Rojas <al...@mesosphere.io>.
> On July 9, 2015, 9:19 p.m., Ben Mahler wrote:
> > 3rdparty/libprocess/src/process.cpp, lines 2815-2819
> > <https://reviews.apache.org/r/30032/diff/14/?file=986489#file986489line2815>
> >
> > Any reason we didn't convert os::stat::mtime to return a Time?
> >
> > The only other user of os::stat::mtime does the same messy conversion:
> >
> > ```
> > Future<Nothing> Slave::garbageCollect(const string& path)
> > {
> > Try<long> mtime = os::stat::mtime(path);
> > if (mtime.isError()) {
> > LOG(ERROR) << "Failed to find the mtime of '" << path
> > << "': " << mtime.error();
> > return Failure(mtime.error());
> > }
> >
> > // It is unsafe for testing to use unix time directly, we must use
> > // Time::create to convert into a Time object that reflects the
> > // possibly advanced state of the libprocess Clock.
> > Try<Time> time = Time::create(mtime.get());
> > CHECK_SOME(time);
> > ```
>
> Till Toenshoff wrote:
> One reason could be that os::stat::mtime lives in stout whereas Time lives in libprocess, no?
Till is right, it is the only reason. `os::stat::mtime` is part of stout while `Time` is part of libprocess. We look into moving `Time` to stout, but there is a dependency to the clock which forbids the transition.
> On July 9, 2015, 9:19 p.m., Ben Mahler wrote:
> > 3rdparty/libprocess/src/process.cpp, line 2833
> > <https://reviews.apache.org/r/30032/diff/14/?file=986489#file986489line2833>
> >
> > Why did you need the {} here?
It initializes a struct to be zero. It is equivalent to do `memset(&clientMTime, 0, sizeof(clientMTime))`, although my original patch called for using the more standard `= {0}` some previous reviewer suggested to change it to the version in the patch.
> On July 9, 2015, 9:19 p.m., Ben Mahler wrote:
> > 3rdparty/libprocess/src/process.cpp, lines 2839-2846
> > <https://reviews.apache.org/r/30032/diff/14/?file=986489#file986489line2839>
> >
> > Any reason to prefer -1 special cases here to just using Try<Time> and handling errors?
-1 is the value returned in error by `std::mktime`. As mentioned before, we couldn't use `Time`. Though it is possible to create a `Time` from a `time_t` initialized with `mktime`. I feel it just adds more points of failure.
- Alexander
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/30032/#review91149
-----------------------------------------------------------
On June 17, 2015, 5:42 p.m., Alexander Rojas wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/30032/
> -----------------------------------------------------------
>
> (Updated June 17, 2015, 5:42 p.m.)
>
>
> Review request for mesos, Benjamin Hindman, Bernd Mathiske, Joerg Schad, Michael Park, and Till Toenshoff.
>
>
> Bugs: mesos-708
> https://issues.apache.org/jira/browse/mesos-708
>
>
> Repository: mesos
>
>
> Description
> -------
>
> When serving a static file, libprocess returns the header `Last-Modified` which is used by browsers to control Cache.
> When a http request arrives containing the header `If-Modified-Since`, a response `304 Not Modified` is returned if the date in the request and the modification time (as returned by doing `stat` in the file) coincide.
> Unit tests added.
>
>
> Diffs
> -----
>
> 3rdparty/libprocess/include/process/http.hpp e47cc7afbc8110759edf25a2dc05d09eda25c417
> 3rdparty/libprocess/src/process.cpp a67a3afdb30d23eb1b265b04ae662f64e874b6c6
> 3rdparty/libprocess/src/tests/process_tests.cpp 660af45e7fd45bdf5d43ad9aa54477fd94f87058
>
> Diff: https://reviews.apache.org/r/30032/diff/
>
>
> Testing
> -------
>
> make check
>
>
> Thanks,
>
> Alexander Rojas
>
>
Re: Review Request 30032: Added support for cache control in
libprocess when dealing with static files.
Posted by Ben Mahler <be...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/30032/#review91149
-----------------------------------------------------------
3rdparty/libprocess/src/process.cpp (lines 2815 - 2819)
<https://reviews.apache.org/r/30032/#comment144432>
Any reason we didn't convert os::stat::mtime to return a Time?
The only other user of os::stat::mtime does the same messy conversion:
```
Future<Nothing> Slave::garbageCollect(const string& path)
{
Try<long> mtime = os::stat::mtime(path);
if (mtime.isError()) {
LOG(ERROR) << "Failed to find the mtime of '" << path
<< "': " << mtime.error();
return Failure(mtime.error());
}
// It is unsafe for testing to use unix time directly, we must use
// Time::create to convert into a Time object that reflects the
// possibly advanced state of the libprocess Clock.
Try<Time> time = Time::create(mtime.get());
CHECK_SOME(time);
```
3rdparty/libprocess/src/process.cpp (line 2827)
<https://reviews.apache.org/r/30032/#comment144436>
Shouldn't this say if the file hasn't been modified since the requested time? Note that a < comparison becomes possible when dealing with Time rather than time_t.
3rdparty/libprocess/src/process.cpp (line 2833)
<https://reviews.apache.org/r/30032/#comment144431>
Why did you need the {} here?
3rdparty/libprocess/src/process.cpp (lines 2839 - 2846)
<https://reviews.apache.org/r/30032/#comment144439>
Any reason to prefer -1 special cases here to just using Try<Time> and handling errors?
3rdparty/libprocess/src/process.cpp (lines 2852 - 2859)
<https://reviews.apache.org/r/30032/#comment144429>
Why isn't this in the `if (modified)` branch below?
3rdparty/libprocess/src/process.cpp (lines 2857 - 2858)
<https://reviews.apache.org/r/30032/#comment144430>
Mind lining this up according to the style guide and the code around you?
3rdparty/libprocess/src/tests/process_tests.cpp (line 1680)
<https://reviews.apache.org/r/30032/#comment144445>
How about s/cache/HttpCache/ ?
We should probably start pulling out http server tests.
3rdparty/libprocess/src/tests/process_tests.cpp (line 1711)
<https://reviews.apache.org/r/30032/#comment144440>
std::string here but string above? Mind removing the std:: qualifiers?
3rdparty/libprocess/src/tests/process_tests.cpp (lines 1726 - 1743)
<https://reviews.apache.org/r/30032/#comment144442>
Yikes, could we add library support for parsing into Time to clean this up? Looks like it could be a lot cleaner.
3rdparty/libprocess/src/tests/process_tests.cpp (lines 1747 - 1751)
<https://reviews.apache.org/r/30032/#comment144447>
Mind just using AWAIT_EXPECT_RESPONSE_STATUS_EQ to clean this up a bit? Ditto for the other cases here.
- Ben Mahler
On June 17, 2015, 3:42 p.m., Alexander Rojas wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/30032/
> -----------------------------------------------------------
>
> (Updated June 17, 2015, 3:42 p.m.)
>
>
> Review request for mesos, Benjamin Hindman, Bernd Mathiske, Joerg Schad, Michael Park, and Till Toenshoff.
>
>
> Bugs: mesos-708
> https://issues.apache.org/jira/browse/mesos-708
>
>
> Repository: mesos
>
>
> Description
> -------
>
> When serving a static file, libprocess returns the header `Last-Modified` which is used by browsers to control Cache.
> When a http request arrives containing the header `If-Modified-Since`, a response `304 Not Modified` is returned if the date in the request and the modification time (as returned by doing `stat` in the file) coincide.
> Unit tests added.
>
>
> Diffs
> -----
>
> 3rdparty/libprocess/include/process/http.hpp e47cc7afbc8110759edf25a2dc05d09eda25c417
> 3rdparty/libprocess/src/process.cpp a67a3afdb30d23eb1b265b04ae662f64e874b6c6
> 3rdparty/libprocess/src/tests/process_tests.cpp 660af45e7fd45bdf5d43ad9aa54477fd94f87058
>
> Diff: https://reviews.apache.org/r/30032/diff/
>
>
> Testing
> -------
>
> make check
>
>
> Thanks,
>
> Alexander Rojas
>
>
Re: Review Request 30032: Added support for cache control in
libprocess when dealing with static files.
Posted by Alexander Rojas <al...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/30032/#review91875
-----------------------------------------------------------
3rdparty/libprocess/src/tests/process_tests.cpp (lines 1757 - 1761)
<https://reviews.apache.org/r/30032/#comment145574>
I think the error was the lack of an await here.
- Alexander Rojas
On June 17, 2015, 5:42 p.m., Alexander Rojas wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/30032/
> -----------------------------------------------------------
>
> (Updated June 17, 2015, 5:42 p.m.)
>
>
> Review request for mesos, Benjamin Hindman, Bernd Mathiske, Joerg Schad, Michael Park, and Till Toenshoff.
>
>
> Bugs: mesos-708
> https://issues.apache.org/jira/browse/mesos-708
>
>
> Repository: mesos
>
>
> Description
> -------
>
> When serving a static file, libprocess returns the header `Last-Modified` which is used by browsers to control Cache.
> When a http request arrives containing the header `If-Modified-Since`, a response `304 Not Modified` is returned if the date in the request and the modification time (as returned by doing `stat` in the file) coincide.
> Unit tests added.
>
>
> Diffs
> -----
>
> 3rdparty/libprocess/include/process/http.hpp e47cc7afbc8110759edf25a2dc05d09eda25c417
> 3rdparty/libprocess/src/process.cpp a67a3afdb30d23eb1b265b04ae662f64e874b6c6
> 3rdparty/libprocess/src/tests/process_tests.cpp 660af45e7fd45bdf5d43ad9aa54477fd94f87058
>
> Diff: https://reviews.apache.org/r/30032/diff/
>
>
> Testing
> -------
>
> make check
>
>
> Thanks,
>
> Alexander Rojas
>
>
Re: Review Request 30032: Added support for cache control in
libprocess when dealing with static files.
Posted by Till Toenshoff <to...@me.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/30032/#review91103
-----------------------------------------------------------
Ship it!
3rdparty/libprocess/src/tests/process_tests.cpp (line 1680)
<https://reviews.apache.org/r/30032/#comment144367>
A short description on the target of this test would be terriffic -- will fix this while committing.
- Till Toenshoff
On June 17, 2015, 3:42 p.m., Alexander Rojas wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/30032/
> -----------------------------------------------------------
>
> (Updated June 17, 2015, 3:42 p.m.)
>
>
> Review request for mesos, Benjamin Hindman, Bernd Mathiske, Joerg Schad, Michael Park, and Till Toenshoff.
>
>
> Bugs: mesos-708
> https://issues.apache.org/jira/browse/mesos-708
>
>
> Repository: mesos
>
>
> Description
> -------
>
> When serving a static file, libprocess returns the header `Last-Modified` which is used by browsers to control Cache.
> When a http request arrives containing the header `If-Modified-Since`, a response `304 Not Modified` is returned if the date in the request and the modification time (as returned by doing `stat` in the file) coincide.
> Unit tests added.
>
>
> Diffs
> -----
>
> 3rdparty/libprocess/include/process/http.hpp e47cc7afbc8110759edf25a2dc05d09eda25c417
> 3rdparty/libprocess/src/process.cpp a67a3afdb30d23eb1b265b04ae662f64e874b6c6
> 3rdparty/libprocess/src/tests/process_tests.cpp 660af45e7fd45bdf5d43ad9aa54477fd94f87058
>
> Diff: https://reviews.apache.org/r/30032/diff/
>
>
> Testing
> -------
>
> make check
>
>
> Thanks,
>
> Alexander Rojas
>
>
Re: Review Request 30032: Added support for cache control in
libprocess when dealing with static files.
Posted by Mesos ReviewBot <re...@mesos.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/30032/#review88240
-----------------------------------------------------------
Patch looks great!
Reviews applied: [34703, 30032]
All tests passed.
- Mesos ReviewBot
On June 17, 2015, 3:42 p.m., Alexander Rojas wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/30032/
> -----------------------------------------------------------
>
> (Updated June 17, 2015, 3:42 p.m.)
>
>
> Review request for mesos, Benjamin Hindman, Bernd Mathiske, Joerg Schad, Michael Park, and Till Toenshoff.
>
>
> Bugs: mesos-708
> https://issues.apache.org/jira/browse/mesos-708
>
>
> Repository: mesos
>
>
> Description
> -------
>
> When serving a static file, libprocess returns the header `Last-Modified` which is used by browsers to control Cache.
> When a http request arrives containing the header `If-Modified-Since`, a response `304 Not Modified` is returned if the date in the request and the modification time (as returned by doing `stat` in the file) coincide.
> Unit tests added.
>
>
> Diffs
> -----
>
> 3rdparty/libprocess/include/process/http.hpp e47cc7afbc8110759edf25a2dc05d09eda25c417
> 3rdparty/libprocess/src/process.cpp a67a3afdb30d23eb1b265b04ae662f64e874b6c6
> 3rdparty/libprocess/src/tests/process_tests.cpp 660af45e7fd45bdf5d43ad9aa54477fd94f87058
>
> Diff: https://reviews.apache.org/r/30032/diff/
>
>
> Testing
> -------
>
> make check
>
>
> Thanks,
>
> Alexander Rojas
>
>
Re: Review Request 30032: Added support for cache control in
libprocess when dealing with static files.
Posted by Alexander Rojas <al...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/30032/
-----------------------------------------------------------
(Updated June 17, 2015, 5:42 p.m.)
Review request for mesos, Benjamin Hindman, Bernd Mathiske, Joerg Schad, Michael Park, and Till Toenshoff.
Changes
-------
Addresses Bernd's review
Bugs: mesos-708
https://issues.apache.org/jira/browse/mesos-708
Repository: mesos
Description
-------
When serving a static file, libprocess returns the header `Last-Modified` which is used by browsers to control Cache.
When a http request arrives containing the header `If-Modified-Since`, a response `304 Not Modified` is returned if the date in the request and the modification time (as returned by doing `stat` in the file) coincide.
Unit tests added.
Diffs (updated)
-----
3rdparty/libprocess/include/process/http.hpp e47cc7afbc8110759edf25a2dc05d09eda25c417
3rdparty/libprocess/src/process.cpp a67a3afdb30d23eb1b265b04ae662f64e874b6c6
3rdparty/libprocess/src/tests/process_tests.cpp 660af45e7fd45bdf5d43ad9aa54477fd94f87058
Diff: https://reviews.apache.org/r/30032/diff/
Testing
-------
make check
Thanks,
Alexander Rojas
Re: Review Request 30032: Added support for cache control in
libprocess when dealing with static files.
Posted by Alexander Rojas <al...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/30032/
-----------------------------------------------------------
(Updated June 17, 2015, 4:08 a.m.)
Review request for mesos, Benjamin Hindman, Bernd Mathiske, Joerg Schad, Michael Park, and Till Toenshoff.
Changes
-------
Forcing rebuild, since it failed thanks to flaky test.
Bugs: mesos-708
https://issues.apache.org/jira/browse/mesos-708
Repository: mesos
Description
-------
When serving a static file, libprocess returns the header `Last-Modified` which is used by browsers to control Cache.
When a http request arrives containing the header `If-Modified-Since`, a response `304 Not Modified` is returned if the date in the request and the modification time (as returned by doing `stat` in the file) coincide.
Unit tests added.
Diffs (updated)
-----
3rdparty/libprocess/include/process/http.hpp e47cc7afbc8110759edf25a2dc05d09eda25c417
3rdparty/libprocess/src/process.cpp a67a3afdb30d23eb1b265b04ae662f64e874b6c6
3rdparty/libprocess/src/tests/process_tests.cpp 660af45e7fd45bdf5d43ad9aa54477fd94f87058
Diff: https://reviews.apache.org/r/30032/diff/
Testing
-------
make check
Thanks,
Alexander Rojas
Re: Review Request 30032: Added support for cache control in
libprocess when dealing with static files.
Posted by Alexander Rojas <al...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/30032/
-----------------------------------------------------------
(Updated June 16, 2015, 9:53 a.m.)
Review request for mesos, Benjamin Hindman, Bernd Mathiske, Joerg Schad, Michael Park, and Till Toenshoff.
Changes
-------
Added missing break line.
Bugs: mesos-708
https://issues.apache.org/jira/browse/mesos-708
Repository: mesos
Description
-------
When serving a static file, libprocess returns the header `Last-Modified` which is used by browsers to control Cache.
When a http request arrives containing the header `If-Modified-Since`, a response `304 Not Modified` is returned if the date in the request and the modification time (as returned by doing `stat` in the file) coincide.
Unit tests added.
Diffs (updated)
-----
3rdparty/libprocess/include/process/http.hpp e47cc7afbc8110759edf25a2dc05d09eda25c417
3rdparty/libprocess/src/process.cpp a67a3afdb30d23eb1b265b04ae662f64e874b6c6
3rdparty/libprocess/src/tests/process_tests.cpp 660af45e7fd45bdf5d43ad9aa54477fd94f87058
Diff: https://reviews.apache.org/r/30032/diff/
Testing
-------
make check
Thanks,
Alexander Rojas
Re: Review Request 30032: Added support for cache control in
libprocess when dealing with static files.
Posted by Mesos ReviewBot <re...@mesos.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/30032/#review87939
-----------------------------------------------------------
Patch looks great!
Reviews applied: [34703, 30032]
All tests passed.
- Mesos ReviewBot
On June 15, 2015, 3:27 p.m., Alexander Rojas wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/30032/
> -----------------------------------------------------------
>
> (Updated June 15, 2015, 3:27 p.m.)
>
>
> Review request for mesos, Benjamin Hindman, Bernd Mathiske, Joerg Schad, Michael Park, and Till Toenshoff.
>
>
> Bugs: mesos-708
> https://issues.apache.org/jira/browse/mesos-708
>
>
> Repository: mesos
>
>
> Description
> -------
>
> When serving a static file, libprocess returns the header `Last-Modified` which is used by browsers to control Cache.
> When a http request arrives containing the header `If-Modified-Since`, a response `304 Not Modified` is returned if the date in the request and the modification time (as returned by doing `stat` in the file) coincide.
> Unit tests added.
>
>
> Diffs
> -----
>
> 3rdparty/libprocess/include/process/http.hpp e47cc7afbc8110759edf25a2dc05d09eda25c417
> 3rdparty/libprocess/src/process.cpp f919b997287435381dbe34cb5bfdf73641ebeb23
> 3rdparty/libprocess/src/tests/process_tests.cpp 660af45e7fd45bdf5d43ad9aa54477fd94f87058
>
> Diff: https://reviews.apache.org/r/30032/diff/
>
>
> Testing
> -------
>
> make check
>
>
> Thanks,
>
> Alexander Rojas
>
>
Re: Review Request 30032: Added support for cache control in
libprocess when dealing with static files.
Posted by Alexander Rojas <al...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/30032/
-----------------------------------------------------------
(Updated June 15, 2015, 5:27 p.m.)
Review request for mesos, Benjamin Hindman, Bernd Mathiske, Joerg Schad, Michael Park, and Till Toenshoff.
Changes
-------
User `Time::create` to create time objects. Removes unnecessary code.
Bugs: mesos-708
https://issues.apache.org/jira/browse/mesos-708
Repository: mesos
Description
-------
When serving a static file, libprocess returns the header `Last-Modified` which is used by browsers to control Cache.
When a http request arrives containing the header `If-Modified-Since`, a response `304 Not Modified` is returned if the date in the request and the modification time (as returned by doing `stat` in the file) coincide.
Unit tests added.
Diffs (updated)
-----
3rdparty/libprocess/include/process/http.hpp e47cc7afbc8110759edf25a2dc05d09eda25c417
3rdparty/libprocess/src/process.cpp f919b997287435381dbe34cb5bfdf73641ebeb23
3rdparty/libprocess/src/tests/process_tests.cpp 660af45e7fd45bdf5d43ad9aa54477fd94f87058
Diff: https://reviews.apache.org/r/30032/diff/
Testing
-------
make check
Thanks,
Alexander Rojas