Skip to content

Commit

Permalink
Add debug logs to investigate crashing fra-ai
Browse files Browse the repository at this point in the history
  • Loading branch information
leszko committed Jan 10, 2025
1 parent b026313 commit 5d28982
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,6 @@ COPY --from=build /usr/bin/grpc_health_probe /usr/local/bin/grpc_health_probe
COPY --from=build /src/tasmodel.pb /tasmodel.pb
COPY --from=build /usr/share/misc/pci.ids /usr/share/misc/pci.ids

RUN apt update && apt install net-tools lsof -y

ENTRYPOINT ["/usr/local/bin/livepeer"]
4 changes: 4 additions & 0 deletions media/mediamtx.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,14 @@ func (mc *MediaMTXClient) KickInputConnection(ctx context.Context) error {
return err
}

clog.Infof(ctx, "Sending req to MediaMTX")

Check warning on line 67 in media/mediamtx.go

View check run for this annotation

Codecov / codecov/patch

media/mediamtx.go#L67

Added line #L67 was not covered by tests
req, err := http.NewRequest(http.MethodPost, fmt.Sprintf("http://%s:%s/v3/%s/kick/%s", mc.host, mediaMTXControlPort, apiPath, mc.sourceID), nil)
if err != nil {
return fmt.Errorf("failed to create kick request: %w", err)
}
req.SetBasicAuth(mediaMTXControlUser, mc.apiPassword)
resp, err := http.DefaultClient.Do(req)
clog.Infof(ctx, "Done Sending req to MediaMTX")

Check warning on line 74 in media/mediamtx.go

View check run for this annotation

Codecov / codecov/patch

media/mediamtx.go#L74

Added line #L74 was not covered by tests
if err != nil {
return fmt.Errorf("failed to kick connection: %w", err)
}
Expand All @@ -85,12 +87,14 @@ func (mc *MediaMTXClient) StreamExists() (bool, error) {
if err != nil {
return false, err
}
clog.Infof(context.Background(), "StreamExist: Sending request to MediaMTX, sourceID=%v", mc.sourceID)

Check warning on line 90 in media/mediamtx.go

View check run for this annotation

Codecov / codecov/patch

media/mediamtx.go#L90

Added line #L90 was not covered by tests
req, err := http.NewRequest(http.MethodGet, fmt.Sprintf("http://%s:%s/v3/%s/get/%s", mc.host, mediaMTXControlPort, apiPath, mc.sourceID), nil)
if err != nil {
return false, fmt.Errorf("failed to create get stream request: %w", err)
}
req.SetBasicAuth(mediaMTXControlUser, mc.apiPassword)
resp, err := http.DefaultClient.Do(req)
clog.Infof(context.Background(), "StreamExist: Done Sending request to MediaMTX, sourceID=%v", mc.sourceID)

Check warning on line 97 in media/mediamtx.go

View check run for this annotation

Codecov / codecov/patch

media/mediamtx.go#L97

Added line #L97 was not covered by tests
if err != nil {
return false, fmt.Errorf("failed to get stream: %w", err)
}
Expand Down
1 change: 1 addition & 0 deletions media/rtmp2segment.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ func (ms *MediaSegmenter) RunSegmentation(ctx context.Context, in string, segmen

retryCount := 0
for {
clog.Infof(ctx, "Checking if stream exists, sourceID=%v, retryCount=%v", ms.MediaMTXClient.sourceID, retryCount)

Check warning on line 44 in media/rtmp2segment.go

View check run for this annotation

Codecov / codecov/patch

media/rtmp2segment.go#L44

Added line #L44 was not covered by tests
streamExists, err := ms.MediaMTXClient.StreamExists()
if err != nil {
clog.Errorf(ctx, "StreamExists check failed. err=%s", err)
Expand Down

0 comments on commit 5d28982

Please sign in to comment.