From 8388a44374b16eeb85cf6954503aa993d80a33d7 Mon Sep 17 00:00:00 2001 From: Wendi Onwuakpa Date: Fri, 13 Dec 2024 11:53:48 -0500 Subject: [PATCH 1/2] fixed panics, added description for file share full error --- cmd/make.go | 2 +- ste/jobStatusManager.go | 7 +++++-- ste/mgr-JobMgr.go | 5 ++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/cmd/make.go b/cmd/make.go index 13c900c20..ef2603497 100644 --- a/cmd/make.go +++ b/cmd/make.go @@ -208,6 +208,6 @@ func init() { }, } - makeCmd.PersistentFlags().Uint32Var(&rawArgs.quota, "quota-gb", 0, "Specifies the maximum size of the share in gigabytes (GiB), 0 means you accept the file service's default quota.") + makeCmd.PersistentFlags().Uint32Var(&rawArgs.quota, "quota-gb", 0, "Specifies the maximum size of the share in gigabytes (GiB), 0 means you accept the file service's default quota. If `ShareSizeLimitReached` error is hit, increase quota and call resume command.") rootCmd.AddCommand(makeCmd) } diff --git a/ste/jobStatusManager.go b/ste/jobStatusManager.go index 39b42569e..fc352e664 100755 --- a/ste/jobStatusManager.go +++ b/ste/jobStatusManager.go @@ -44,6 +44,7 @@ type jobStatusManager struct { xferDone chan xferDoneMsg xferDoneDrained chan struct{} // To signal that all xferDone have been processed statusMgrDone chan struct{} // To signal statusManager has closed + isChanClosed bool } func (jm *jobMgr) waitToDrainXferDone() { @@ -139,10 +140,12 @@ func (jm *jobMgr) handleStatusUpdateMessage() { case msg, ok := <-jstm.xferDone: if !ok { // Channel is closed, all transfers have been attended. jstm.xferDone = nil - // close drainXferDone so that other components can know no further updates happen allXferDoneHandled = true - close(jstm.xferDoneDrained) + if jstm.xferDoneDrained != nil { + close(jstm.xferDoneDrained) + jstm.xferDoneDrained = nil + } continue } diff --git a/ste/mgr-JobMgr.go b/ste/mgr-JobMgr.go index d4895b73b..d4a5e90cf 100755 --- a/ste/mgr-JobMgr.go +++ b/ste/mgr-JobMgr.go @@ -715,7 +715,10 @@ func (jm *jobMgr) reportJobPartDoneHandler() { (isCancelling && !haveFinalPart) // If we're cancelling, it's OK to try to exit early; the user already accepted this job cannot be resumed. Outgoing requests will fail anyway, so nothing can properly clean up. if shouldComplete { // Inform StatusManager that all parts are done. - close(jm.jstm.xferDone) + if jm.jstm.xferDone != nil { + close(jm.jstm.xferDone) + jm.jstm.xferDone = nil + } // Wait for all XferDone messages to be processed by statusManager. Front end // depends on JobStatus to determine if we've to quit job. Setting it here without From 826b35ffd5af74a2a37920cedd7274ab4e251bfb Mon Sep 17 00:00:00 2001 From: Wendi Onwuakpa Date: Fri, 13 Dec 2024 12:22:28 -0500 Subject: [PATCH 2/2] linting fix --- ste/jobStatusManager.go | 1 - 1 file changed, 1 deletion(-) diff --git a/ste/jobStatusManager.go b/ste/jobStatusManager.go index fc352e664..4d4bb0f89 100755 --- a/ste/jobStatusManager.go +++ b/ste/jobStatusManager.go @@ -44,7 +44,6 @@ type jobStatusManager struct { xferDone chan xferDoneMsg xferDoneDrained chan struct{} // To signal that all xferDone have been processed statusMgrDone chan struct{} // To signal statusManager has closed - isChanClosed bool } func (jm *jobMgr) waitToDrainXferDone() {