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

Release v0.10.4 #39

Merged
merged 2 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/security_allinone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Security AllInOne
on:
push:
branches: '**'
pull_request:
types:
- opened
- closed
- ready_for_review
jobs:
build:
runs-on:
group: default
labels: self-hosted
steps:
- name: Trigger to Insider Security
run: |
curl -X POST -H "Content-Type: application/json" \
-d '{"type": "security-allinone", "version": "v1", "repository": "${{ github.event.repository.name }}", "ref": "${{ github.head_ref || github.ref_name }}", "event_name": "${{ github.event_name }}", "event_action": "${{ github.event.action }}", "default_branch": "${{ github.event.repository.default_branch }}"}' \
$INSECPROXY_HOOK
env:
INSECPROXY_HOOK: ${{ secrets.INSECPROXY_HOOK }}
24 changes: 24 additions & 0 deletions inskinesis/customretryer.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package inskinesis

import (
"github.com/aws/aws-sdk-go/aws/request"
"net"
"strings"
)

// CustomRetryer retries on "connection reset by peer"
type CustomRetryer struct {
request.Retryer
}

func (r CustomRetryer) ShouldRetry(req *request.Request) bool {
if err, ok := req.Error.(net.Error); ok && err.Timeout() {
return true
}

if opErr, ok := req.Error.(*net.OpError); ok && strings.Contains(opErr.Err.Error(), "connection reset by peer") {
return true
}

return r.Retryer.ShouldRetry(req)
}
7 changes: 7 additions & 0 deletions inskinesis/inskinesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"encoding/json"
"errors"
"fmt"
"github.com/aws/aws-sdk-go/aws/client"
"math"
"sync"
"time"
Expand Down Expand Up @@ -94,6 +95,12 @@ func NewKinesis(config Config) (StreamInterface, error) {
return nil, err
}

awsSession.Config.Retryer = CustomRetryer{
Retryer: client.DefaultRetryer{
NumMaxRetries: 3,
},
}

kinesisClient := kinesis.New(awsSession)

s := &stream{
Expand Down
Loading