Skip to content

Commit

Permalink
Merge pull request #99 from LiilyZhang/issue2972
Browse files Browse the repository at this point in the history
Issue 2972 - mms object publish will hang and return 504 if object is…
  • Loading branch information
linggao authored Feb 3, 2022
2 parents 3c8bfb9 + efbd039 commit 048592d
Show file tree
Hide file tree
Showing 18 changed files with 511 additions and 276 deletions.
26 changes: 16 additions & 10 deletions common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -502,10 +502,6 @@ type MetaData struct {
// Optional field, default is false (not visiable to all users)
Public bool `json:"public" bson:"public"`

// DataVerified is an internal field set by ESS after ESS downloads data from CSS or by CSS after ESS uploads data
// Data can be obtained only when DataVerified field is true
DataVerified bool `json:"dataVerified" bson:"data-verified"`

// OwnerID is an internal field indicating who creates the object
// This field should not be set by users
OwnerID string `json:"ownerID" bson:"owner-id"`
Expand Down Expand Up @@ -678,6 +674,10 @@ type DestinationRequestInQueue struct {
Destination Destination
}

type ObjectInVerifyQueue struct {
Object MetaData
}

// ACLentry contains ACL information about each user
type ACLentry struct {
Username string
Expand All @@ -687,14 +687,20 @@ type ACLentry struct {

// Object status
const (
// status at sender side
NotReadyToSend = "notReady" // The object is not ready to be sent to the other side
Verifying = "verifying" // The object data is in the process of verification
VerificationFailed = "verificationFailed" // The data verification is failed
ReadyToSend = "ready" // The object is ready to be sent to the other side
PartiallyReceived = "partiallyreceived" // Received the object from the other side, waiting for its data
CompletelyReceived = "completelyReceived" // The object was received completely from the other side
ObjConsumed = "objconsumed" // The object was consumed by the app
ObjDeleted = "objdeleted" // The object was deleted by the other side
ObjReceived = "objreceived" // The object was received by the app
ConsumedByDest = "consumedByDest" // The object was consumed by the other side (ESS only)
// status at receiver side
PartiallyReceived = "partiallyreceived" // Received the object from the other side, waiting for its data
ReceiverVerifying = "receiverVerifying" // The object data at receiver side is in the process of verification
ReceiverVerificationFailed = "receiverVerificationFailed" // The data verification is failed at receiver side
CompletelyReceived = "completelyReceived" // The object was received completely from the other side
ObjConsumed = "objconsumed" // The object was consumed by the app
ObjDeleted = "objdeleted" // The object was deleted by the other side
ObjReceived = "objreceived" // The object was received by the app
ConsumedByDest = "consumedByDest" // The object was consumed by the other side (ESS only)
)

// Notification status and type
Expand Down
9 changes: 9 additions & 0 deletions common/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ type Config struct {
// For the ESS, default value is 2
ObjectQueueBufferSize uint64 `env:"OBJECT_QUEUE_BUFFER_SIZE"`

// Buffer size of Object Queue to verify object data
// Default size is 500
VerifyQueueBufferSize uint64 `env:"VERIFY_QUEUE_BUFFER_SIZE"`

// CommunicationProtocol is a comma separated list of protocols to be used for communication between CSS and ESS
// The elements of the list can be 'http', 'mqtt', and 'wiotp'
// wiotp indicates MQTT communication via the Watson IoT Platform and mqtt indicates direct MQTT communication to a broker
Expand Down Expand Up @@ -690,6 +694,10 @@ func ValidateConfig() error {
}
}

if Configuration.VerifyQueueBufferSize == 0 {
Configuration.VerifyQueueBufferSize = 500
}

return nil
}

Expand All @@ -705,6 +713,7 @@ func SetDefaultConfig(config *Config) {
config.SecureListeningPort = 8443
config.UnsecureListeningPort = 8080
config.LeadershipTimeout = 30
config.VerifyQueueBufferSize = 500
config.AuthenticationHandler = "dummy"
config.CSSOnWIoTP = false
config.UsingEdgeConnector = false
Expand Down
Loading

0 comments on commit 048592d

Please sign in to comment.