Skip to content

Conversation

@fpdotmonkey
Copy link
Contributor

Up to this commit, timeout errors have been inspecific about which timeout is being tripped. This can be frustrating, as timeout errors are user-facing and often require action by the user, either to adjust timeout durations or to do deeper diagnosis on the hardware.

This creates better error messages by adding a label to all timeouts so that they will report which particular timeout they tripped.

The other most notable change is that
crate::timer_factory::TimeoutFuture has had it's .duration field added regardless of whether it's built with miri. I needed to add TimeoutKind to this struct no matter what and I felt it would be silly to separate it from Duration just for miri's sake.

I've tested this on Beckhoff's EK1100, EL3104, EL4134, EL6224, EL1259, EL6751, HBM's TIM EC, and Bosch-Rexroth's VT-HMC. The latter also exercised the PDU timeouts in addition to the regular timer factory ones.

@fpdotmonkey fpdotmonkey force-pushed the labeled-timeouts branch 2 times, most recently from 00c050e to 0fab93e Compare July 14, 2025 15:07
@fpdotmonkey
Copy link
Contributor Author

netbsd failed on replay-ek1914-no-complete-access. I don't think it failed on previous runs, and that test doesn't fail on linux for me at least. Strange...

Copy link
Collaborator

@jamwaffles jamwaffles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few nits and reorg bits, otherwise this is really good, thank you! I too get those dreaded Init: Timeout errors with no recourse but to drag Wireshark out. It will be nice to have a middle ground.

@jamwaffles
Copy link
Collaborator

Don't worry about the netbsd tests. Not sure why they're failing but everything else is fine.

Also I just noticed Timeouts::mailbox_response is never used. Is that a missed refactor in your code or does EtherCrab just never use mailbox_response?

@fpdotmonkey
Copy link
Contributor Author

Also I just noticed Timeouts::mailbox_response is never used. Is that a missed refactor in your code or does EtherCrab just never use mailbox_response?

I think mailbox_response is just never used. I checked in subdevice/mod.rs, and where you'd expect it, I'm seeing mailbox_echo, e.g. in SubDeviceRef::coe_response.

@fpdotmonkey fpdotmonkey force-pushed the labeled-timeouts branch 2 times, most recently from 732e2fd to 00959df Compare July 14, 2025 16:33
fpdotmonkey and others added 2 commits November 15, 2025 17:09
Up to this commit, timeout errors have been inspecific about which
timeout is being tripped.  This can be frustrating, as timeout errors
are user-facing and often require action by the user, either to adjust
timeout durations or to do deeper diagnosis on the hardware.

This creates better error messages by adding a label to all timeouts so
that they will report which particular timeout they tripped.

The other most notable change is that
`crate::timer_factory::TimeoutFuture` has had it's `.duration` field
added regardless of whether it's built with miri.  I needed to add
`TimeoutKind` to this struct no matter what and I felt it would be silly
to separate it from `Duration` just for miri's sake.

I've tested this on Beckhoff's EK1100, EL3104, EL4134, EL6224, EL1259,
EL6751, HBM's TIM EC, and Bosch-Rexroth's VT-HMC.  The latter also
exercised the PDU timeouts in addition to the regular timer factory
ones.
(and some minor cleanup in that file)
Copy link
Collaborator

@jamwaffles jamwaffles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the massive delay on this. I've pushed a changelog entry commit, now verything looks good, thanks again!

@jamwaffles jamwaffles enabled auto-merge (squash) November 16, 2025 01:12
@jamwaffles jamwaffles merged commit 69487eb into ethercrab-rs:main Nov 16, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants