|
9 | 9 | #include <workerd/io/worker.h> |
10 | 10 | #include <workerd/jsg/jsg.h> |
11 | 11 | #include <workerd/jsg/setup.h> |
12 | | -#include <workerd/util/autogate.h> |
13 | 12 | #include <workerd/util/own-util.h> |
14 | 13 | #include <workerd/util/sentry.h> |
15 | 14 | #include <workerd/util/uncaught-exception-source.h> |
@@ -942,15 +941,12 @@ kj::Own<WorkerInterface> IoContext::getSubrequestNoChecks( |
942 | 941 | } |
943 | 942 |
|
944 | 943 | // Subrequests use a lot of unaccounted C++ memory, so we adjust V8's external memory counter to |
945 | | - // pressure the GC and protect against OOMs. When the autogate is enabled, we apply this |
946 | | - // adjustment to ALL subrequests (not just fetch). We only apply this when the JS lock is held |
947 | | - // (i.e., when JS code initiated the subrequest); infrastructure paths that bypass JS don't need |
948 | | - // it. |
949 | | - if (util::Autogate::isEnabled(util::AutogateKey::INCREASE_EXTERNAL_MEMORY_ADJUSTMENT_FOR_FETCH)) { |
950 | | - KJ_IF_SOME(lock, currentLock) { |
951 | | - jsg::Lock& js = lock; |
952 | | - ret = ret.attach(js.getExternalMemoryAdjustment(8 * 1024)); |
953 | | - } |
| 944 | + // pressure the GC and protect against OOMs. We apply this adjustment to ALL subrequests (not |
| 945 | + // just fetch). We only apply this when the JS lock is held (i.e., when JS code initiated the |
| 946 | + // subrequest); infrastructure paths that bypass JS don't need it. |
| 947 | + KJ_IF_SOME(lock, currentLock) { |
| 948 | + jsg::Lock& js = lock; |
| 949 | + ret = ret.attach(js.getExternalMemoryAdjustment(8 * 1024)); |
954 | 950 | } |
955 | 951 |
|
956 | 952 | return kj::mv(ret); |
@@ -1042,13 +1038,11 @@ kj::Own<CacheClient> IoContext::getCacheClient() { |
1042 | 1038 | limitEnforcer->newSubrequest(false); |
1043 | 1039 | auto ret = getIoChannelFactory().getCache(); |
1044 | 1040 |
|
1045 | | - // Apply external memory adjustment for Cache API subrequests when autogate is enabled (same as |
1046 | | - // other subrequests in getSubrequestNoChecks). |
1047 | | - if (util::Autogate::isEnabled(util::AutogateKey::INCREASE_EXTERNAL_MEMORY_ADJUSTMENT_FOR_FETCH)) { |
1048 | | - KJ_IF_SOME(lock, currentLock) { |
1049 | | - jsg::Lock& js = lock; |
1050 | | - ret = ret.attach(js.getExternalMemoryAdjustment(8 * 1024)); |
1051 | | - } |
| 1041 | + // Apply external memory adjustment for Cache API subrequests (same as other subrequests in |
| 1042 | + // getSubrequestNoChecks). |
| 1043 | + KJ_IF_SOME(lock, currentLock) { |
| 1044 | + jsg::Lock& js = lock; |
| 1045 | + ret = ret.attach(js.getExternalMemoryAdjustment(8 * 1024)); |
1052 | 1046 | } |
1053 | 1047 |
|
1054 | 1048 | return kj::mv(ret); |
|
0 commit comments