Skip to content

Commit d38e663

Browse files
Preslav LeConvex, Inc.
Preslav Le
authored and
Convex, Inc.
committed
Remove block_logging from ActionCallbacks trait. (#25534)
block_logging is very confusing. It is part of ActionCallbacks trait, which means it is serialized and deserialized from protos. However, all that obfuscates the fact that block_logging is always false for action callbacks. Thus the whole thing is redundant. To help clean this up, remove block_logging from the trait and set it to false. We could pass log_visibility into ApplicationFunctionRunner, so we can check if we should block visibility, but this will always return false since actions have AllowedVisibility::All anyway, so passing this and creating transactions in order to do the check seem like an overkill. GitOrigin-RevId: 3be542a7f2860e31b36a7506be1fa2054bb1b28a
1 parent f84d827 commit d38e663

File tree

5 files changed

+9
-12
lines changed

5 files changed

+9
-12
lines changed

crates/application/src/application_function_runner/mod.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1954,9 +1954,10 @@ impl<RT: Runtime> ActionCallbacks for ApplicationFunctionRunner<RT> {
19541954
identity: Identity,
19551955
name: UdfPath,
19561956
args: Vec<JsonValue>,
1957-
block_logging: bool,
19581957
context: ExecutionContext,
19591958
) -> anyhow::Result<FunctionResult> {
1959+
// We never block logging for functions called by actions.
1960+
let block_logging = false;
19601961
let ts = self.database.now_ts_for_reads();
19611962
let result = self
19621963
.run_query_at_ts(
@@ -1982,9 +1983,10 @@ impl<RT: Runtime> ActionCallbacks for ApplicationFunctionRunner<RT> {
19821983
identity: Identity,
19831984
name: UdfPath,
19841985
args: Vec<JsonValue>,
1985-
block_logging: bool,
19861986
context: ExecutionContext,
19871987
) -> anyhow::Result<FunctionResult> {
1988+
// We never block logging for functions called by actions.
1989+
let block_logging = false;
19881990
let result = self
19891991
.retry_mutation(
19901992
context.request_id,
@@ -2012,9 +2014,10 @@ impl<RT: Runtime> ActionCallbacks for ApplicationFunctionRunner<RT> {
20122014
identity: Identity,
20132015
name: UdfPath,
20142016
args: Vec<JsonValue>,
2015-
block_logging: bool,
20162017
context: ExecutionContext,
20172018
) -> anyhow::Result<FunctionResult> {
2019+
// We never block logging for functions called by actions.
2020+
let block_logging = false;
20182021
let _tx = self.database.begin(identity.clone()).await?;
20192022
let result = self
20202023
.run_action(

crates/isolate/src/client.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,6 @@ pub trait ActionCallbacks: Send + Sync {
275275
identity: Identity,
276276
name: UdfPath,
277277
args: Vec<JsonValue>,
278-
block_logging: bool,
279278
context: ExecutionContext,
280279
) -> anyhow::Result<FunctionResult>;
281280

@@ -284,7 +283,6 @@ pub trait ActionCallbacks: Send + Sync {
284283
identity: Identity,
285284
name: UdfPath,
286285
args: Vec<JsonValue>,
287-
block_logging: bool,
288286
context: ExecutionContext,
289287
) -> anyhow::Result<FunctionResult>;
290288

@@ -293,7 +291,6 @@ pub trait ActionCallbacks: Send + Sync {
293291
identity: Identity,
294292
name: UdfPath,
295293
args: Vec<JsonValue>,
296-
block_logging: bool,
297294
context: ExecutionContext,
298295
) -> anyhow::Result<FunctionResult>;
299296

crates/isolate/src/environment/action/async_syscall.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ impl<RT: Runtime> TaskExecutor<RT> {
9393
self.identity.clone(),
9494
udf_path,
9595
args.into_arg_vec(),
96-
false,
9796
self.context.clone(),
9897
)
9998
.await?
@@ -124,7 +123,6 @@ impl<RT: Runtime> TaskExecutor<RT> {
124123
self.identity.clone(),
125124
udf_path,
126125
args.into_arg_vec(),
127-
false,
128126
self.context.clone(),
129127
)
130128
.await?
@@ -152,7 +150,6 @@ impl<RT: Runtime> TaskExecutor<RT> {
152150
self.identity.clone(),
153151
udf_path,
154152
args.into_arg_vec(),
155-
false,
156153
self.context.clone(),
157154
)
158155
.await?

crates/isolate/src/test_helpers.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1146,7 +1146,6 @@ impl<RT: Runtime, P: Persistence + Clone> ActionCallbacks for UdfTest<RT, P> {
11461146
identity: Identity,
11471147
name: UdfPath,
11481148
args: Vec<JsonValue>,
1149-
_block_logging: bool,
11501149
_context: ExecutionContext,
11511150
) -> anyhow::Result<FunctionResult> {
11521151
let arguments = parse_udf_args(&name, args)?;
@@ -1167,7 +1166,6 @@ impl<RT: Runtime, P: Persistence + Clone> ActionCallbacks for UdfTest<RT, P> {
11671166
identity: Identity,
11681167
name: UdfPath,
11691168
args: Vec<JsonValue>,
1170-
_block_logging: bool,
11711169
_context: ExecutionContext,
11721170
) -> anyhow::Result<FunctionResult> {
11731171
let arguments = parse_udf_args(&name, args)?;
@@ -1188,7 +1186,6 @@ impl<RT: Runtime, P: Persistence + Clone> ActionCallbacks for UdfTest<RT, P> {
11881186
identity: Identity,
11891187
name: UdfPath,
11901188
args: Vec<JsonValue>,
1191-
_block_logging: bool,
11921189
_context: ExecutionContext,
11931190
) -> anyhow::Result<FunctionResult> {
11941191
let arguments = parse_udf_args(&name, args)?;

crates/pb/protos/backend.proto

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ message ExecuteQueryRequest {
7171

7272
convex_identity.UncheckedIdentity identity = 2;
7373
common.PathAndArgs path_and_args = 3;
74+
// TODO(presley): Delete
7475
optional bool block_logging = 5;
7576
optional common.ExecutionContext execution_context = 6;
7677

@@ -89,6 +90,7 @@ message ExecuteMutationRequest {
8990

9091
convex_identity.UncheckedIdentity identity = 2;
9192
common.PathAndArgs path_and_args = 3;
93+
// TODO(presley): Delete
9294
optional bool block_logging = 5;
9395
optional common.ExecutionContext execution_context = 6;
9496

@@ -107,6 +109,7 @@ message ExecuteActionRequest {
107109

108110
convex_identity.UncheckedIdentity identity = 2;
109111
common.PathAndArgs path_and_args = 3;
112+
// TODO(presley): Delete
110113
optional bool block_logging = 5;
111114
optional common.ExecutionContext execution_context = 6;
112115

0 commit comments

Comments
 (0)