You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by pa...@apache.org on 2023/06/21 21:14:50 UTC
[beam] branch master updated: [Playground] Decrease severity of not important log messages (#27116)
This is an automated email from the ASF dual-hosted git repository.
pabloem pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git
The following commit(s) were added to refs/heads/master by this push:
new fddc5adc181 [Playground] Decrease severity of not important log messages (#27116)
fddc5adc181 is described below
commit fddc5adc181586f50d51d36314dd9ad520437395
Author: Timur Sultanov <ti...@akvelon.com>
AuthorDate: Thu Jun 22 01:14:39 2023 +0400
[Playground] Decrease severity of not important log messages (#27116)
* Decrease log message severity for catalog cache timeout messages
* Decrease severity of readiness check messages
* Log transaction errors as warnings
* Decrease severity of run error messages as they litter logs when user supplied code crashes
* Revert "Decrease severity of readiness check messages"
This reverts commit 9663bbad8a24e8dd1ee6cb634c23f05a4c420c03.
---
playground/backend/internal/cache/redis/redis_cache.go | 2 +-
playground/backend/internal/code_processing/code_processing.go | 2 +-
playground/backend/internal/components/cache_component.go | 4 ++--
playground/backend/internal/db/datastore/datastore_db.go | 2 +-
playground/backend/internal/utils/file_utils.go | 4 ++--
5 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/playground/backend/internal/cache/redis/redis_cache.go b/playground/backend/internal/cache/redis/redis_cache.go
index 909cd28403a..71baa635da0 100644
--- a/playground/backend/internal/cache/redis/redis_cache.go
+++ b/playground/backend/internal/cache/redis/redis_cache.go
@@ -121,7 +121,7 @@ func (rc *Cache) SetCatalog(ctx context.Context, catalog []*pb.Categories) error
func (rc *Cache) GetCatalog(ctx context.Context) ([]*pb.Categories, error) {
value, err := rc.Get(ctx, cache.ExamplesCatalog).Result()
if err != nil {
- logger.Errorf("Redis Cache: get catalog: error during Get operation for key: %s, err: %s\n", cache.ExamplesCatalog, err.Error())
+ logger.Warnf("Redis Cache: get catalog: error during Get operation for key: %s, err: %s\n", cache.ExamplesCatalog, err.Error())
return nil, err
}
var result []*pb.Categories
diff --git a/playground/backend/internal/code_processing/code_processing.go b/playground/backend/internal/code_processing/code_processing.go
index 06bc8335701..f874a048ac9 100644
--- a/playground/backend/internal/code_processing/code_processing.go
+++ b/playground/backend/internal/code_processing/code_processing.go
@@ -608,7 +608,7 @@ func processErrorWithSavingOutput(err error, errorOutput []byte, pipelineId uuid
// sets corresponding status to the cache.
func processRunError(errorChannel chan error, errorOutput []byte, pipelineId uuid.UUID, cacheService cache.Cache, stopReadLogsChannel, finishReadLogsChannel chan bool) error {
err := <-errorChannel
- logger.Errorf("%s: Run(): err: %s, output: %s\n", pipelineId, err.Error(), errorOutput)
+ logger.Warnf("%s: Run(): err: %s, output: %s\n", pipelineId, err.Error(), errorOutput)
if err := utils.SetToCache(cacheService, pipelineId, cache.RunError, fmt.Sprintf("error: %s\noutput: %s", err.Error(), string(errorOutput))); err != nil {
return err
diff --git a/playground/backend/internal/components/cache_component.go b/playground/backend/internal/components/cache_component.go
index 72d6c6213dc..fad44914490 100644
--- a/playground/backend/internal/components/cache_component.go
+++ b/playground/backend/internal/components/cache_component.go
@@ -43,7 +43,7 @@ func (cp *CacheComponent) GetSdkCatalogFromCacheOrDatastore(ctx context.Context,
defer cancel()
sdks, err := cp.cache.GetSdkCatalog(cctx)
if err != nil {
- logger.Errorf("error during getting the sdk catalog from the cache, err: %s", err.Error())
+ logger.Warnf("error during getting the sdk catalog from the cache, err: %s", err.Error())
return cp.getSdks(ctx, cacheRequestTimeout)
} else {
return sdks, nil
@@ -71,7 +71,7 @@ func (cp *CacheComponent) GetCatalogFromCacheOrDatastore(ctx context.Context, ca
defer cancel()
catalog, err := cp.cache.GetCatalog(cctx)
if err != nil {
- logger.Errorf("error during getting the catalog from the cache, err: %s", err.Error())
+ logger.Warnf("error during getting the catalog from the cache, err: %s", err.Error())
return cp.getCatalog(ctx, cacheRequestTimeout)
} else {
return catalog, nil
diff --git a/playground/backend/internal/db/datastore/datastore_db.go b/playground/backend/internal/db/datastore/datastore_db.go
index c110a61487a..7b92c915d2e 100644
--- a/playground/backend/internal/db/datastore/datastore_db.go
+++ b/playground/backend/internal/db/datastore/datastore_db.go
@@ -583,7 +583,7 @@ func (d *Datastore) DeleteUnusedSnippets(ctx context.Context, retentionPeriod ti
func rollback(tx *datastore.Transaction) {
err := tx.Rollback()
if err != nil {
- logger.Errorf(errorMsgTemplateTxRollback, err.Error())
+ logger.Warnf(errorMsgTemplateTxRollback, err.Error())
}
}
diff --git a/playground/backend/internal/utils/file_utils.go b/playground/backend/internal/utils/file_utils.go
index 5e0d524363c..61fef90dd9c 100644
--- a/playground/backend/internal/utils/file_utils.go
+++ b/playground/backend/internal/utils/file_utils.go
@@ -124,14 +124,14 @@ func getExtBasedOnContent(content string) string {
// getCorrectNameOrDefault returns the correct file name or default name.
func getCorrectNameOrDefault(actualExt, correctExt, defaultFileName, name string) string {
if actualExt == "" {
- logger.Error("The name of the file does not have extension. Will be used default value")
+ logger.Infof("The name of the file does not have extension. Default value (%s) will be used", correctExt)
if name == "" {
return defaultFileName
}
return name + correctExt
}
if actualExt != correctExt {
- logger.Error("The name of the file has wrong extension. Will be used correct extension according to sdk")
+ logger.Infof("The name of the file has wrong extension. Correct extension (%s) will be used according to sdk", correctExt)
return name[0:len(name)-len(actualExt)] + correctExt
}
if filepath.Ext(name) == "" {