bootsnap 1.18.2 → 1.18.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/ext/bootsnap/bootsnap.c +6 -5
- data/lib/bootsnap/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4fa4ab785277ee01a1c8ee75b43f0efb93db42bffcdacc1c8505a65efa03dede
|
4
|
+
data.tar.gz: 8aaaca48ae257b563580023c8fa36a59463f4c30f5463c14f6b8b94bf5fe27df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27b48d27d3330c8565952a2fbb979e71013b1e9585bcb3284656192808c304f2874c32a135b14895eec61a7ef038fa71fa111964a56e7aaedc9ff507ef307686
|
7
|
+
data.tar.gz: c3d83a0b068f2908a6298c7cd8e1a660f1228a7ddbfb9409cb3f6c174319f3974388ce73756c04062b17b97a37e199a07bccbb0b8dc1c6224998c58c51194b27
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# Unreleased
|
2
2
|
|
3
|
+
# 1.18.3
|
4
|
+
|
5
|
+
* Fix the cache corruption issue in the revalidation feature. See #474.
|
6
|
+
The cache revalidation feature remains opt-in for now, until it is more battle tested.
|
7
|
+
|
3
8
|
# 1.18.2
|
4
9
|
|
5
10
|
* Disable stale cache entries revalidation by default as it seems to cause cache corruption issues. See #471 and #474.
|
data/ext/bootsnap/bootsnap.c
CHANGED
@@ -124,7 +124,7 @@ static void bs_cache_path(const char * cachedir, const VALUE path, char (* cache
|
|
124
124
|
static int bs_read_key(int fd, struct bs_cache_key * key);
|
125
125
|
static enum cache_status cache_key_equal_fast_path(struct bs_cache_key * k1, struct bs_cache_key * k2);
|
126
126
|
static int cache_key_equal_slow_path(struct bs_cache_key * current_key, struct bs_cache_key * cached_key, const VALUE input_data);
|
127
|
-
static int update_cache_key(struct bs_cache_key *current_key, int cache_fd, const char ** errno_provenance);
|
127
|
+
static int update_cache_key(struct bs_cache_key *current_key, struct bs_cache_key *old_key, int cache_fd, const char ** errno_provenance);
|
128
128
|
|
129
129
|
static void bs_cache_key_digest(struct bs_cache_key * key, const VALUE input_data);
|
130
130
|
static VALUE bs_fetch(char * path, VALUE path_v, char * cache_path, VALUE handler, VALUE args);
|
@@ -353,10 +353,11 @@ static int cache_key_equal_slow_path(struct bs_cache_key *current_key,
|
|
353
353
|
return current_key->digest == cached_key->digest;
|
354
354
|
}
|
355
355
|
|
356
|
-
static int update_cache_key(struct bs_cache_key *current_key, int cache_fd, const char ** errno_provenance)
|
356
|
+
static int update_cache_key(struct bs_cache_key *current_key, struct bs_cache_key *old_key, int cache_fd, const char ** errno_provenance)
|
357
357
|
{
|
358
|
+
old_key->mtime = current_key->mtime;
|
358
359
|
lseek(cache_fd, 0, SEEK_SET);
|
359
|
-
ssize_t nwrite = write(cache_fd,
|
360
|
+
ssize_t nwrite = write(cache_fd, old_key, KEY_SIZE);
|
360
361
|
if (nwrite < 0) {
|
361
362
|
*errno_provenance = "update_cache_key:write";
|
362
363
|
return -1;
|
@@ -825,7 +826,7 @@ bs_fetch(char * path, VALUE path_v, char * cache_path, VALUE handler, VALUE args
|
|
825
826
|
valid_cache = cache_key_equal_slow_path(¤t_key, &cached_key, input_data);
|
826
827
|
if (valid_cache) {
|
827
828
|
if (!readonly) {
|
828
|
-
if (update_cache_key(¤t_key, cache_fd, &errno_provenance)) {
|
829
|
+
if (update_cache_key(¤t_key, &cached_key, cache_fd, &errno_provenance)) {
|
829
830
|
exception_message = path_v;
|
830
831
|
goto fail_errno;
|
831
832
|
}
|
@@ -993,7 +994,7 @@ bs_precompile(char * path, VALUE path_v, char * cache_path, VALUE handler)
|
|
993
994
|
}
|
994
995
|
valid_cache = cache_key_equal_slow_path(¤t_key, &cached_key, input_data);
|
995
996
|
if (valid_cache) {
|
996
|
-
if (update_cache_key(¤t_key, cache_fd, &errno_provenance)) {
|
997
|
+
if (update_cache_key(¤t_key, &cached_key, cache_fd, &errno_provenance)) {
|
997
998
|
goto fail;
|
998
999
|
}
|
999
1000
|
}
|
data/lib/bootsnap/version.rb
CHANGED