<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
To avoid this 'going around releaseRequest() API' I would like<br>
to suggest renaming 'RELEASE_REQUEST' flag to something<br>
more suitable, e.g., 'ENTRY_REUSABLE' and adding a helper<br>
API avoiding direct flag manipulation. This would not contradict<br>
with the existing setReleaseFlag() meaning (i.e., "marking the <br>
corresponding entry for eventual removal"), adding an additional<br>
meaning (i.e., since then, the entry is not suggested to be re-used<br>
by others). This intersects a little with the existing 'private
entries'<br>
definition. However, private entries may eventually become public,<br>
while an entry with ENTRY_REUSABLE unset, would stay 'private'<br>
until it is removed.<br>
<br>
<br>
Eduard.<br>
<br>
<div class="moz-cite-prefix">On 24.07.2017 02:00, Eduard Bagdasaryan
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:ed7c0303-1d97-d813-e1c0-4c69a44ec560@measurement-factory.com">On
23.07.2017 02:04, Alex Rousskov wrote:
<br>
<blockquote type="cite" style="color: #000000;">
<blockquote type="cite" style="color: #000000;">+ if
(!flags.cachable)
<br>
+ EBIT_SET(e->flags, RELEASE_REQUEST);
<br>
</blockquote>
This release request feels out of place and direct flags setting
goes
<br>
around the existing releaseRequest() API. Please check all
callers --
<br>
perhaps we do not need the above because all callers already do
an
<br>
equivalent action (e.g., makePrivate()) for "uncachable"
requests?
<br>
</blockquote>
<br>
I don't think this lines are 'out of place':
storeCreatePureEntry() just
<br>
initializes the just created StoreEntry fields (including
<br>
StoreEntry::flags) with correct values. If we definitely know a
<br>
this moment that 'flags' should have RELEASE_REQUEST set, why do
we need
<br>
to postpone this to many callers, hoping that all of them will do
that
<br>
work correctly? There are lots of storeCreateEntry() calls and it
is
<br>
hardly possible to track that all of them end up with
<br>
'releaseRequest()', when flags.cachable is false. BTW, at the
time of
<br>
StoreEntry initialization we do not need to do most of the work
<br>
releaseRequest() does. E.g., there are no connected storages to
<br>
disconnect from, no public keys to make them private, etc. The
only
<br>
thing to do is RELEASE_REQUEST flag setting.</blockquote>
<br>
</body>
</html>