-
Notifications
You must be signed in to change notification settings - Fork 8
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
TransactionLogger.waitForIndexer waits for failed transactions and transactions that have already been found #363
Comments
Using latest round defeats the purpose of being scoped to the transactions in the logger, but what could be done is look up the transaction id(s) in the logger (the latest one is probably enough unless it's an invalid transaction?) and then wait for the round of that particular transaction. |
Do we expect someone to use the transaction logger to send some transactions and then not use for others? I suppose it's just not clear to me why/how this would be used externally. Using transactions adds a lot of complexity vs simply asking "is indexer caught up" because we'd also need to have logic that handles failed transactions |
We can use "indexer caught up to algod" for sure, it's just slower if you are doing parallel test runs.
Not sure I understand this sentence? The logger isn't sending transactions just logging when they are sent. |
Ah didn't think of parallel tests... I meant do we expect the logger to not have the latest transactions that were sent to algod, and in the case of parallel tests (where each test has its own instance of logger) then the answer could be yes. How much slower are we talking? Is the slowdown intermittent or is indexer consistently slow in catching up? I typically avoid using indexer so it's been awhile since I've had first hand experience with it. I'm just trying to gauge whether it's worth adding the complexity for tracking failed transactions |
The other option is do nothing. It's so unlikely with per test scoping that it's even an issue if we are only waiting for the last transaction. |
(this behaviour has been there since this functionality was first implemented and noone has complained about it except when it was waiting for all transactions with global scoping, which will naturally show the problem up) |
I don't think ignoring a bug in something that is publicly exposed is a reasonable path forward. I would imagine it's never caused known issues before because we actively discourage people from using indexer at all so most users don't even have a need for |
I agree in principle, but my point is just this is an edge case since most times you call this will be right after you have issued transactions you've waited for (and thus they will throw before you hit this method). |
Either way, no issue in it being solved, but I think when the other change is merged that fixes the implementation to only check the latest txid the urgency is low. |
side-note: having a method that waits for indexer to catch up to latest algod round is a perfectly valid method to have, and we may even decide it makes sense to expose as the main |
My main concern is tests that involve catching an exception from a failed transaction. It would be one thing if it threw an error, but indefinitely hanging is a really nasty behavior to debug. I agree the chance of this occurring is low, especially considering the usage of the function itself is low, but I don't love having something that can break in an ugly way. If we don't want to do "wait for last round" (which would be a breaking change, but #355 is going to be a breaking change anyways) I would rather have logic that pops reject txns than doing nothing despite the additional complexity. |
Subject of the issue
There are currently two issues with
waitForIndexer
waitForIndexer
does not track which transactions have already been found, meaning it will waste time waiting for a transaction that is already known to be in indexerwaitForIndexer
will wait (unscessfully) for failed transactions to show up indexerThere are two potential solutions
waitForIndexer
(part of fix: waitForIndexer waiting for transactions that failed #358)The text was updated successfully, but these errors were encountered: