fresh-borzoni commented on code in PR #127:
URL: https://github.com/apache/fluss-rust/pull/127#discussion_r2664834430
##########
crates/fluss/src/client/table/scanner.rs:
##########
@@ -171,10 +182,32 @@ impl LogScanner {
log_scanner_status.clone(),
projected_fields,
)?,
+ poll_mode: AtomicU8::new(POLL_MODE_UNSET),
})
}
pub async fn poll(&self, timeout: Duration) -> Result<ScanRecords> {
+ // Check and set poll mode to prevent mixing with poll_batches
+ match self.poll_mode.compare_exchange(
+ POLL_MODE_UNSET,
+ POLL_MODE_RECORDS,
+ Ordering::AcqRel,
+ Ordering::Acquire,
Review Comment:
We may use Relaxed as well, but it's safer to go with Acquire if this flag
would involve more dependencies and act as a gate.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]