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

FifoTransactionManager: Transaction never removed after errorCallback #159

Closed
submerged15 opened this issue Apr 30, 2017 · 2 comments
Closed

Comments

@submerged15
Copy link

submerged15 commented Apr 30, 2017

Hi,

I'm using pymodbus over RS485 with RtuFramer and AsyncModbusProtocol based on the twisted serialport. (Python 2.7)

Whenever there are multiple slaves attached and one of them is disabled, there is a reponse/transaction mismatch. The request of the disabled slave never return any response and any further requests with any other slaves too. No timeout is ever reached and I have to call the errorCallback manually.

I figured out that, after the errorCallback is called, the TransactionManager (RtuFramer uses FifoTransactionManager) still contains the failed deferred. Any future request with valid response tries to match with that failed deferred and therefore discard the response. The FifoTransactionManager tries always to match the first element of the list and not the x element based on the Transaction-ID.

def getTransaction(self, tid):
_logger.debug("getting transaction %s" % str(tid))
return self.transactions.pop(0) if self.transactions else None

Workaround: Delete the failed transaction in my errorCallback method.

Solution: Add handling for failed requests.

@dhoomakethu dhoomakethu added this to the 1.3.0 milestone May 12, 2017
@dhoomakethu
Copy link
Contributor

I believe there is a fix in one of the raised PR's, It will be available as part of 1.3.0 release

dhoomakethu added a commit that referenced this issue May 16, 2017
2. addresses issues in #159, #156, #148, #121
@dhoomakethu dhoomakethu mentioned this issue May 16, 2017
Merged
@dhoomakethu
Copy link
Contributor

fixed with pymodbus v1.3.0rc1

dhoomakethu added a commit to bhagn/pymodbus that referenced this issue Oct 10, 2017
dhoomakethu added a commit that referenced this issue Oct 26, 2017
2. addresses issues in #159, #156, #148, #121
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants