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

Forward error codes through pipeline #183

Open
gavv opened this issue May 15, 2019 · 1 comment
Open

Forward error codes through pipeline #183

gavv opened this issue May 15, 2019 · 1 comment
Labels
c api Task affects public C API enhancement

Comments

@gavv
Copy link
Member

gavv commented May 15, 2019

This task tracks support for reporting errors (status codes) from pipeline operations (construction, read and write).

Errors should be forwarded through the whole pipeline up to the user, and exposed via C API.

Depends on #303 and #614.

@gavv gavv modified the milestones: 0.1, 0.1.0, 0.1.1 May 31, 2019
@gavv gavv removed this from the 0.1.1 milestone Jun 6, 2019
@gavv gavv changed the title Add support for runtime pipeline errors Report runtime pipeline errors Dec 19, 2019
@gavv gavv added the c api Task affects public C API label Dec 19, 2019
@gavv gavv changed the title Report runtime pipeline errors Support runtime pipeline errors Sep 29, 2023
@gavv
Copy link
Member Author

gavv commented Sep 29, 2023

Status codes

  • NoStatus
  • StatusOK
  • StatusPart
  • StatusDrain
  • StatusAbort
  • StatusEnd
  • StatusNoMem
  • StatusNoRoute
  • StatusErrDevice
  • StatusErrFile
  • StatusErrNetwork
  • StatusErrThread
  • StatusErrRand
  • StatusBadSlot
  • StatusBadInterface
  • StatusBadProtocol
  • StatusBadConfig
  • StatusBadPacket
  • StatusBadBuffer
  • StatusBadArg
  • StatusBadOperation

Port to statuses

init_status

Replace is_valid() with init_status(), and report initialization error codes.

  • roc_packet
  • roc_rtp
  • roc_rtcp
  • roc_fec
  • roc_audio
  • roc_pipeline
  • roc_ctl
  • roc_node
  • roc_sndio
  • roc_netio

readers & writers (#303, #614)

Update packet and frame readers and writers to return status, and report read/write error codes. Use StatusEnd instead of is_alive() to terminate sessions.

  • roc_packet
  • roc_rtp
  • roc_rtcp
  • roc_fec
  • roc_audio
  • roc_pipeline
  • roc_node
  • roc_sndio
  • roc_netio

refresh

Return and forward status from refresh().

  • add status to SenderSink::refresh()
  • add status to ReceiverSource::refresh()
  • forward status from RTCP to refresh()
  • in PipelineLoop, forward status from write() and refresh() via process_subframe_imp() via process_subframes_and_tasks() to SenderLoop::write() and ReceiverLoop::read()
  • in SenderLoop and ReceiverLoop, forward refresh status as read/write error

sessions

  • redirect session read/write errors to refresh() errors
  • trigger session removal by refresh() errors
  • don't use is_alive() in pipeline

routing

Return and handle StatusNoRoute.

  • ReceiverSession
  • ReceiverSessionRouter
  • ReceiverSessionGroup
  • ReceiverEndpoint
  • SenderEndpoint

parsers & composers (#737, #766)

Update IParser & IComposer implementations to return statuses instead of booleans.

  • parsers
  • composers

encoders & decoders (#739, #738, #767)

Update encoder and decoder implementations to return statuses instead of booleans.

  • roc_audio (IFrameEncoder, IFrameDecoder)
  • roc_fec (IBlockEncoder, IBlockDecoder)

fec reader & writer

Fix error reporting in fec::BlockReader and fec::BlockWriter.

  • return StatusAbort when session is broken
  • uses statuses instead of is_alive()
  • report all internal failures via status codes
  • forward all errors from block encoder / decoder

control operations

Return statuses when creating slots, endpoints, etc. Forwards statuses through pipeline tasks.

  • receiver
    • ReceiverSessionGroup
    • ReceiverSlot
    • ReceiverSource
    • ReceiverLoop
  • sender
    • SenderSession
    • SenderSlot
    • SenderSink
    • SenderLoop

network operations

Migrate TCP classes to roc_status codes. SocketError enum should be hidden implementation detail.

  • UDP
  • TCP

device operations

Return status codes for operations.

  • io (return correct status)
  • open
  • pause
  • resume
  • restart
  • flush
  • close

API

  • add error codes to C API
  • update adapters
  • forward errors to user

gavv added a commit to gavv/roc-toolkit that referenced this issue Dec 28, 2023
gavv added a commit to gavv/roc-toolkit that referenced this issue Dec 28, 2023
@gavv gavv changed the title Support runtime pipeline errors Forward error codes through pipeline Apr 29, 2024
gavv added a commit to gavv/roc-toolkit that referenced this issue May 8, 2024
This commit implements small part of roc-streaminggh-183, needed for status codes
in frame readers & writers (roc-streaminggh-614), which in turn is needed for
partial reads & PLC.

Changes:
- add codes from task
- rename StatusNoData => StatusDrain
- remove StatusLimit (instead use StatusNoMem)
- remove StatusConflict (instead use StatusNoRoute)
- remove StatusUnknown

Sponsored-by: waspd
gavv added a commit to gavv/roc-toolkit that referenced this issue May 8, 2024
This commit implements small part of roc-streaminggh-183, needed for status codes
in frame readers & writers (roc-streaminggh-614), which in turn is needed for
partial reads & PLC.

Changes:
- add codes from task
- rename StatusNoData => StatusDrain
- remove StatusLimit (instead use StatusNoMem)
- remove StatusConflict (instead use StatusNoRoute)
- remove StatusUnknown

Sponsored-by: waspd
gavv added a commit to gavv/roc-toolkit that referenced this issue May 8, 2024
This commit implements small part of roc-streaminggh-183, needed for status codes
in frame readers & writers (roc-streaminggh-614), which in turn is needed for
partial reads & PLC.

Changes:
- add codes from task
- rename StatusNoData => StatusDrain
- remove StatusLimit (instead use StatusNoMem)
- remove StatusConflict (instead use StatusNoRoute)
- remove StatusUnknown

Sponsored-by: waspd
gavv added a commit to gavv/roc-toolkit that referenced this issue May 8, 2024
Replace is_valid() with init_status() and forward initialization
errors through pipeline.
gavv added a commit to gavv/roc-toolkit that referenced this issue May 9, 2024
This commit implements small part of roc-streaminggh-183, needed for status codes
in frame readers & writers (roc-streaminggh-614), which in turn is needed for
partial reads & PLC.

Changes:
- add codes from task
- rename StatusNoData => StatusDrain
- remove StatusLimit (instead use StatusNoMem)
- remove StatusConflict (instead use StatusNoRoute)
- remove StatusUnknown

Sponsored-by: waspd
gavv added a commit to gavv/roc-toolkit that referenced this issue May 9, 2024
Replace is_valid() with init_status() and forward initialization
errors through pipeline.

Sponsored-by: waspd
gavv added a commit to gavv/roc-toolkit that referenced this issue May 9, 2024
This commit implements small part of roc-streaminggh-183, needed for status codes
in frame readers & writers (roc-streaminggh-614), which in turn is needed for
partial reads & PLC.

Changes:
- add codes from task
- rename StatusNoData => StatusDrain
- remove StatusLimit (instead use StatusNoMem)
- remove StatusConflict (instead use StatusNoRoute)
- remove StatusUnknown

Sponsored-by: waspd
gavv added a commit to gavv/roc-toolkit that referenced this issue May 9, 2024
Replace is_valid() with init_status() and forward initialization
errors through pipeline.

Sponsored-by: waspd
gavv added a commit to gavv/roc-toolkit that referenced this issue Jun 20, 2024
This commit implements a part of roc-streaminggh-183 (pipeline error forwarding),
needed for roc-streaminggh-614 (status codes for frame writers/readers).

It updates the list of status codes to be up-to-date with the task.
Most of the codes are not yet actually used.

Changes:
- add missing codes from task
- rename StatusNoData => StatusDrain
- remove StatusLimit (instead use StatusNoMem)
- remove StatusConflict (instead use StatusNoRoute)
- remove StatusUnknown

Sponsored-by: waspd
gavv added a commit to gavv/roc-toolkit that referenced this issue Jun 20, 2024
This commit implements a part of roc-streaminggh-183 (pipeline error forwarding),
needed for roc-streaminggh-614 (status codes for frame writers/readers).

It replaces is_valid() in pipeline elements with init_status(), and
forwards initialization errors through pipeline.

Without it, when a function should forward a status, and both
initialization and read/write errors can happen, it wouldn't be
clear what status to return in case of initialization error.

Sponsored-by: waspd
gavv added a commit to gavv/roc-toolkit that referenced this issue Jun 20, 2024
gavv added a commit to gavv/roc-toolkit that referenced this issue Jun 20, 2024
Handle statuses that can be now returned when routing packet.

Sponsored-by: waspd
gavv added a commit to gavv/roc-toolkit that referenced this issue Jun 20, 2024
Since IFrameReader::read() now can return status, and this status
can be status::StatusAbort, we need to be able to remember it and
return from refresh().

This commit updates refresh() calls to return statuses.

Sponsored-by: waspd
gavv added a commit to gavv/roc-toolkit that referenced this issue Jun 20, 2024
…e packet status

This commit does not change behavior, but restructures code of
Depacketizer so that we can update it to handle status codes
from packet reader and return errors or partial reads.

Sponsored-by: waspd
gavv added a commit to gavv/roc-toolkit that referenced this issue Jun 20, 2024
If underlying packet reader returns error (not StatusOK and
not StatusDrain), Depacketizer forwards this error.

Sponsored-by: waspd
gavv added a commit to gavv/roc-toolkit that referenced this issue Jun 20, 2024
This commit implements a part of roc-streaminggh-183 (pipeline error forwarding),
needed for roc-streaminggh-614 (status codes for frame writers/readers).

It updates the list of status codes to be up-to-date with the task.
Most of the codes are not yet actually used.

Changes:
- add missing codes from task
- rename StatusNoData => StatusDrain
- remove StatusLimit (instead use StatusNoMem)
- remove StatusConflict (instead use StatusNoRoute)
- remove StatusUnknown

Sponsored-by: waspd
gavv added a commit to gavv/roc-toolkit that referenced this issue Jun 20, 2024
This commit implements a part of roc-streaminggh-183 (pipeline error forwarding),
needed for roc-streaminggh-614 (status codes for frame writers/readers).

It replaces is_valid() in pipeline elements with init_status(), and
forwards initialization errors through pipeline.

Without it, when a function should forward a status, and both
initialization and read/write errors can happen, it wouldn't be
clear what status to return in case of initialization error.

Sponsored-by: waspd
gavv added a commit to gavv/roc-toolkit that referenced this issue Jun 20, 2024
gavv added a commit to gavv/roc-toolkit that referenced this issue Jun 20, 2024
Handle statuses that can be now returned when routing packet.

Sponsored-by: waspd
gavv added a commit to gavv/roc-toolkit that referenced this issue Jun 20, 2024
Since IFrameReader::read() now can return status, and this status
can be status::StatusAbort, we need to be able to remember it and
return from refresh().

This commit updates refresh() calls to return statuses.

Sponsored-by: waspd
gavv added a commit to gavv/roc-toolkit that referenced this issue Jun 20, 2024
…handle packet status

This commit does not change behavior, but restructures code of
Depacketizer so that we can update it to handle status codes
from packet reader and return errors or partial reads.

Sponsored-by: waspd
gavv added a commit to gavv/roc-toolkit that referenced this issue Jun 20, 2024
If underlying packet reader returns error (not StatusOK and
not StatusDrain), Depacketizer forwards this error.

Sponsored-by: waspd
gavv added a commit to gavv/roc-toolkit that referenced this issue Jun 20, 2024
This commit implements a part of roc-streaminggh-183 (pipeline error forwarding),
needed for roc-streaminggh-614 (status codes for frame writers/readers).

It updates the list of status codes to be up-to-date with the task.
Most of the codes are not yet actually used.

Changes:
- add missing codes from task
- rename StatusNoData => StatusDrain
- remove StatusLimit (instead use StatusNoMem)
- remove StatusConflict (instead use StatusNoRoute)
- remove StatusUnknown

Sponsored-by: waspd
gavv added a commit to gavv/roc-toolkit that referenced this issue Jun 20, 2024
This commit implements a part of roc-streaminggh-183 (pipeline error forwarding),
needed for roc-streaminggh-614 (status codes for frame writers/readers).

It replaces is_valid() in pipeline elements with init_status(), and
forwards initialization errors through pipeline.

Without it, when a function should forward a status, and both
initialization and read/write errors can happen, it wouldn't be
clear what status to return in case of initialization error.

Sponsored-by: waspd
gavv added a commit to gavv/roc-toolkit that referenced this issue Jun 20, 2024
gavv added a commit to gavv/roc-toolkit that referenced this issue Jun 20, 2024
Handle statuses that can be now returned when routing packet.

Sponsored-by: waspd
gavv added a commit to gavv/roc-toolkit that referenced this issue Jun 20, 2024
Since IFrameReader::read() now can return status, and this status
can be status::StatusAbort, we need to be able to remember it and
return from refresh().

This commit updates refresh() calls to return statuses.

Sponsored-by: waspd
gavv added a commit to gavv/roc-toolkit that referenced this issue Jun 20, 2024
… handle packet status

This commit does not change behavior, but restructures code of
Depacketizer so that we can update it to handle status codes
from packet reader and return errors or partial reads.

Sponsored-by: waspd
gavv added a commit to gavv/roc-toolkit that referenced this issue Jun 20, 2024
If underlying packet reader returns error (not StatusOK and
not StatusDrain), Depacketizer forwards this error.

Sponsored-by: waspd
gavv added a commit to gavv/roc-toolkit that referenced this issue Jun 23, 2024
@gavv gavv added this to Roc Toolkit Jul 6, 2024
@gavv gavv moved this to Frontlog in Roc Toolkit Jul 6, 2024
gavv added a commit to gavv/roc-toolkit that referenced this issue Jul 26, 2024
is_alive() mechanism is replaces with status codes and is
no longer used.
gavv added a commit to gavv/roc-toolkit that referenced this issue Jul 26, 2024
- forward internal failures via status codes (some were ignored,
  some were using panics)

- remove outdated is_alive() mechanism and rely on status
  codes instead

- expect that after reporting failure, read() and write()
  is never called again
gavv added a commit to gavv/roc-toolkit that referenced this issue Jul 28, 2024
roc_status:
- remove StatusConflict (use StatusBadArg)
- rename StatusEnd to StatusFinish
- allow StatusFinish for both read and write
- add StatusBadState

roc_audio:
- both mixer and fanout now handle StatusFinish

roc_sndio:
- new state DeviceState_Broken

roc_pipeline:
- sessions: when session is broken, all operations become no-op,
  refresh() reports error
- sink/source: when sink/source is broken, all operations return
  StatusBadState
- state tracker: set_broken, is_broken
jeshwanthreddy13 pushed a commit to jeshwanthreddy13/roc-toolkit that referenced this issue Aug 6, 2024
is_alive() mechanism is replaces with status codes and is
no longer used.
jeshwanthreddy13 pushed a commit to jeshwanthreddy13/roc-toolkit that referenced this issue Aug 6, 2024
- forward internal failures via status codes (some were ignored,
  some were using panics)

- remove outdated is_alive() mechanism and rely on status
  codes instead

- expect that after reporting failure, read() and write()
  is never called again
jeshwanthreddy13 pushed a commit to jeshwanthreddy13/roc-toolkit that referenced this issue Aug 6, 2024
roc_status:
- remove StatusConflict (use StatusBadArg)
- rename StatusEnd to StatusFinish
- allow StatusFinish for both read and write
- add StatusBadState

roc_audio:
- both mixer and fanout now handle StatusFinish

roc_sndio:
- new state DeviceState_Broken

roc_pipeline:
- sessions: when session is broken, all operations become no-op,
  refresh() reports error
- sink/source: when sink/source is broken, all operations return
  StatusBadState
- state tracker: set_broken, is_broken
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c api Task affects public C API enhancement
Projects
Status: Frontlog
Development

No branches or pull requests

1 participant