-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add volatile_nonatomic_schedule_immediate #1612
Add volatile_nonatomic_schedule_immediate #1612
Conversation
4d58b6a
to
1e77ec5
Compare
d287bbb
to
8a912a9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a PR description, otherwise, approved with some requested changes.
/// - `name` does not point to valid UTF-8 | ||
/// - `name + name_len` or `args + args_len` overflow a 64-bit integer | ||
pub fn _schedule_reducer( | ||
pub fn _volatile_nonatomic_schedule_immediate( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's gate this under feature = "unstable_abi"
.
@@ -197,32 +197,22 @@ pub mod raw { | |||
message_len: usize, | |||
); | |||
|
|||
/// Schedules a reducer to be called asynchronously at `time`. | |||
/// Schedules a reducer to be called asynchronously, nonatomically, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docs here are not fully updated and fully true, but its unstable, so we don't need to care in the interest of time.
crates/bindings/src/lib.rs
Outdated
($($args:tt)*) => { | ||
$crate::__volatile_nonatomic_schedule_immediate_impl!([] [$($args)*]) | ||
}; | ||
} | ||
|
||
#[doc(hidden)] | ||
#[macro_export] | ||
macro_rules! __volatile_nonatomic_schedule_immediate_impl { | ||
([$repeater:path] [($($args:tt)*)]) => { | ||
$crate::__volatile_nonatomic_schedule_immediate_impl!(@process_args $repeater, ($($args)*)) | ||
}; | ||
([$($cur:tt)*] [$next:tt $($rest:tt)*]) => { | ||
$crate::__volatile_nonatomic_schedule_immediate_impl!([$($cur)* $next] [$($rest)*]) | ||
}; | ||
(@process_args $repeater:path, (_$(, $args:expr)* $(,)?)) => { | ||
$crate::__volatile_nonatomic_schedule_immediate_impl!(@call $repeater, ($crate::ReducerContext::__dummy(), $($args),*)) | ||
}; | ||
(@process_args $repeater:path, ($($args:expr),* $(,)?)) => { | ||
$crate::__volatile_nonatomic_schedule_immediate_impl!(@call $repeater, ($($args),*)) | ||
}; | ||
(@call $repeater:path, ($($args:expr),*)) => { | ||
if false { | ||
let _ = $repeater($($args,)*); | ||
} else { | ||
$crate::rt::volatile_nonatomic_schedule_immediate::<_, _, $repeater, _>($repeater, ($($args,)*)) | ||
} | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a whole lot of complication just to support reducer(args)
when reducer, args
would have worked, but oh well, it's been written already :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly just copied it from the old schedule
macro
}; | ||
(@call $repeater:path, ($($args:expr),*)) => { | ||
if false { | ||
let _ = $repeater($($args,)*); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I presume this is for type-checking purposes.
init_update = proc.stdout.readline() | ||
code = proc.poll() | ||
if code: | ||
raise subprocess.CalledProcessError(code, fake_args) | ||
print("initial update:", init_update) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add commentary for this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was giving me an annoying error because I had named the table in the new smoketest "Table", and I was so confused why SELECT * FROM Table
was failing with a parse error (sql is case-insensitive and TABLE
is a keyword). This was part of my debugging that - it makes self.subscribe()
raise the error earlier instead of delaying it til you call sub()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW this was removed in #1536. The errors were being raised inconsistently and causing smoketest flakes.
By forcing all errors into one codepath we removed the surface area for a test to get its error "at the wrong time".
341e906
to
41847eb
Compare
41847eb
to
ecd2fd6
Compare
Implements Tyler's proposal - for bitcraft to get error handling working until nested transactions are a thing.