Skip to content
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

MongoDB transactions are not checked for success #456

Closed
uhliksk opened this issue Aug 6, 2022 · 0 comments
Closed

MongoDB transactions are not checked for success #456

uhliksk opened this issue Aug 6, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@uhliksk
Copy link
Contributor

uhliksk commented Aug 6, 2022

Version

v0.0.88 (9c2e4f5)

Description

MongoDB transactions will fail silently which can cause there are some buy or sell orders not recorded or grid trade is not reset after last sell order is executed.

To Reproduce

It appear occasionally even under light workload. I didn't found specific steps to reproduce.

Expected Behaviours

Retryable transactions should be retried if the first attempt failed or at least the user should be warned there was a failed transaction.

Screenshots

Additional context

There is no check if transaction has been processed successfully. Result is returned but not processed.

const deleteSymbolGridTrade = async (logger, symbol) => {
const result = await mongo.deleteOne(logger, 'trailing-trade-grid-trade', {
key: `${symbol}`
});
await cache.hdel('trailing-trade-configurations', symbol);
return result;
};

// Delete symbol grid trade
await deleteSymbolGridTrade(logger, symbol);

There is not even writeConcern enabled. Transactions will fail silently. Introduced in #288 as "risky but worth" for RPi. Maybe it should be platform specific?

const result = collection.deleteOne(filter, {
// https://docs.mongodb.com/v3.2/reference/write-concern/
writeConcern: {
w: 0,
j: false
}
});

@uhliksk uhliksk added the bug Something isn't working label Aug 6, 2022
@uhliksk uhliksk closed this as completed Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant