Skip to content

RemoterTls does not refresh idle timeout after successful I/O #170

Description

@kentbull

Problem

RemoterTls overrides Remoter.receive() and Remoter.send() for TLS-specific nonblocking errors but omits the idle-timer refresh performed by the corresponding plain TCP methods.

With a nonzero idle timeout, successful TLS application traffic leaves the deadline unchanged. An active TLS connection can therefore be closed as idle.

Reproduction

Against current main, extend the existing test_tcp_tls_default_context test after obtaining ixBeta:

ixBeta.tymeout = 1.0
remaining = []

ixBeta.tymer.start(duration=ixBeta.tymeout)
tymist.tick(tock=0.75)
# Existing client-to-server transfer
remaining.append(ixBeta.tymer.remaining)

ixBeta.tymer.start(duration=ixBeta.tymeout)
tymist.tick(tock=0.75)
# Existing server-to-client transfer
remaining.append(ixBeta.tymer.remaining)

assert remaining == pytest.approx([1.0, 1.0])

Run:

pytest -q tests/core/tcp/test_tcp.py::test_tcp_tls_default_context

Current result:

Obtained: [0.25, 0.25]
Expected: [1.0, 1.0]

The test configures the accepted remoter timer directly to isolate this defect from server timeout propagation.

Expected behavior

RemoterTls should mirror Remoter:

  • Refresh after receiving nonempty application data.
  • Refresh after sending a nonzero byte count.
  • Do not refresh for blocked I/O, EOF, errors, or zero-byte sends.
  • Honor refreshable=False.

Refreshing must reset the deadline relative to current scheduler tyme, as addressed by #169.

Related work

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions