bootsnap 1.1.6 → 1.1.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2750702dbd4dbefceab7f91bf8ebe6ad477b4646
4
- data.tar.gz: b182a96b6addea307c37623196d71d7d4f133bb4
3
+ metadata.gz: 58c56b006431cac3c1cf8a8c8c542f76ec6cd7dd
4
+ data.tar.gz: b71fd217b2aded27b42d582d6a123a80bd6c8747
5
5
  SHA512:
6
- metadata.gz: 9a48aab6bd53e30c06b9209b580724386584c3125669a787d43aeb3a656ded4fac42850ab3c5e3bf22d1efa6b0f6fec94498af20b0f4c613d817290e4440f160
7
- data.tar.gz: b61b313dc2cf9da4aa524ce8f985b6016532237f168f5eda7d89047dc9493f97a03eecdede3c484295264c9eaec6292740ad9fa53dfa7f0d89c3188630530b99
6
+ metadata.gz: 43ce6810dfe1626cb8e9b6213ee197c26123fb98bfd7aaa42b5795a7133349002e86037cea64b94bdf7d1cdc45d42671285ae21693e4c0d25962d5e1dc5b133f
7
+ data.tar.gz: 22545b119efedef68895f61b3f403b6eedb8e6f4a7152da99fed09d430df7bc7125f1d81d5db9ebb45919958c5a215c5968efc34202aa708d7b8349fdb232768
@@ -1,3 +1,8 @@
1
+ # 1.1.7
2
+
3
+ * Create cache entries as 0775/0664 instead of 0755/0644
4
+ * Better handling around cache updates in highly-parallel workloads
5
+
1
6
  # 1.1.6
2
7
 
3
8
  * Assortment of minor bugfixes
@@ -476,13 +476,13 @@ atomic_write_cache_file(char * path, struct bs_cache_key * key, VALUE data, char
476
476
  strcat(dest, ".tmp.XXXXXX");
477
477
 
478
478
  tmp_path = mktemp(template);
479
- fd = open(tmp_path, O_WRONLY | O_CREAT, 0644);
479
+ fd = open(tmp_path, O_WRONLY | O_CREAT, 0664);
480
480
  if (fd < 0) {
481
- if (mkpath(path, 0755) < 0) {
481
+ if (mkpath(path, 0775) < 0) {
482
482
  *errno_provenance = (char *)"bs_fetch:atomic_write_cache_file:mkpath";
483
483
  return -1;
484
484
  }
485
- fd = open(tmp_path, O_WRONLY | O_CREAT, 0644);
485
+ fd = open(tmp_path, O_WRONLY | O_CREAT, 0664);
486
486
  if (fd < 0) {
487
487
  *errno_provenance = (char *)"bs_fetch:atomic_write_cache_file:open";
488
488
  return -1;
@@ -71,8 +71,11 @@ module Bootsnap
71
71
  # caches if they read at an inopportune time.
72
72
  tmp = "#{@store_path}.#{Process.pid}.#{(rand * 100000).to_i}.tmp"
73
73
  FileUtils.mkpath(File.dirname(tmp))
74
- File.binwrite(tmp, MessagePack.dump(@data))
74
+ exclusive_write = File::Constants::CREAT | File::Constants::EXCL | File::Constants::WRONLY
75
+ File.binwrite(tmp, MessagePack.dump(@data), mode: exclusive_write)
75
76
  FileUtils.mv(tmp, @store_path)
77
+ rescue Errno::EEXIST
78
+ retry
76
79
  end
77
80
  end
78
81
  end
@@ -1,3 +1,3 @@
1
1
  module Bootsnap
2
- VERSION = "1.1.6"
2
+ VERSION = "1.1.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootsnap
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.6
4
+ version: 1.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Burke Libbey
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-11 00:00:00.000000000 Z
11
+ date: 2017-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler