Comments (8)
// UpdateVmInfo is func to update VM Info
func UpdateVmInfo(nsId string, mcisId string, vmInfoData TbVmInfo) {
key := common.GenMcisKey(nsId, mcisId, vmInfoData.Id)
// Check existence of the key. If no key, no update.
keyValue, err := common.CBStore.Get(key)
if keyValue == nil || err != nil {
return
}
vmTmp := TbVmInfo{}
json.Unmarshal([]byte(keyValue.Value), &vmTmp)
if !reflect.DeepEqual(vmTmp, vmInfoData) {
val, _ := json.Marshal(vmInfoData)
err = common.CBStore.Put(key, string(val))
if err != nil {
common.CBLog.Error(err)
}
}
}
error handling 보완 필요.
from cb-tumblebug.
// GenMcisKey is func to generate a key used in keyValue store
func GenMcisKey(nsId string, mcisId string, vmId string) string {
if vmId != "" {
return "/ns/" + nsId + "/mcis/" + mcisId + "/vm/" + vmId
} else if mcisId != "" {
return "/ns/" + nsId + "/mcis/" + mcisId
} else if nsId != "" {
return "/ns/" + nsId
} else {
return ""
}
}
error handling 보완 필요.
from cb-tumblebug.
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x47d44b]
goroutine 1033235 [running]:
github.com/cloud-barista/cb-tumblebug/src/core/mcis.GetVmStatusAsync(0xc000e5bc20, 0xc001c6fc12, 0x4, 0xc003a0810e, 0x12, 0xc00184c664, 0x16, 0xc0000dd440, 0x0, 0x0)
/home/son/go/src/github.com/cloud-barista/cb-tumblebug/src/core/mcis/manageInfo.go:907 +0x28f
created by github.com/cloud-barista/cb-tumblebug/src/core/mcis.GetMcisStatus
/home/son/go/src/github.com/cloud-barista/cb-tumblebug/src/core/mcis/manageInfo.go:533 +0x6a9
Makefile:12: recipe for target 'run' failed
make: *** [run] Error 2
from cb-tumblebug.
VM이 많이 포함된 MCIS에서,
내부 VM 정보를 삭제하면,
MCIS 상태 조회 기능에서 오류 발생 가능.
MCIS 상태 조회는 기본적으로 MCIS에 포함된 VM 리스트를 조회하여,
개별 VM에 대해 상태 조회를 하고 MCIS 오브젝트의 정보를 업데이트하는데,
MCIS 상태 조회가 길어지면,
처음 조회하여 가지고 있던 VM list의 수가 상태 조회 중에 변경될 가능성 높음. (VM 삭제 등의 요청 발생하는 경우)
결과적으로는 없는 VM에 대한 처리 요청이 발생할 수 있으며,
에러처리가 잘 안되어 있는 부분에서 nil reference error 및 panic이 발생하는 것으로 추측.
from cb-tumblebug.
MCIS 수를 300개까지 올려보면,
Spider와의 connection 이슈로, hitting the default limit of 1024 "open files 발생함.
관련 솔루션:
https://blog.sensecodons.com/2022/04/golang-httpclient-and-too-many-open.html
세션 확인하기
echo "cb-tb,cb-sp" > ss-tb.log; for run in {1..10000}; do cbtb=$(ss -anp | grep tumblebug | wc -l); cbsp=$(ss -anp | grep spider | wc -l); echo "${cbtb},${cbsp}" >> ss-tb.log; sleep 1; done
from cb-tumblebug.
미봉책: change max file descriptors
https://stackoverflow.com/questions/32325343/go-tcp-too-many-open-files-debug
ulimit 설정이 ubuntu 18.* 에서 오류가 있을 수 있음
해결: https://superuser.com/questions/1200539/cannot-increase-open-file-limit-past-4096-ubuntu/1200818#_=_
from cb-tumblebug.
https://yongho1037.tistory.com/815
from cb-tumblebug.
고루틴 버퍼드 채널 사용 또는
Rate 제한도 방안이 될 수 있음.
https://dev.to/godoylucase/rate-limiting-your-goroutines-1om1
from cb-tumblebug.
Related Issues (20)
- Are there other options for the GCP VM spec in `gcp-asia-northeast3` ? HOT 6
- Remote access/command for a cluster HOT 3
- Azure k8s cluster provisioning failure HOT 5
- [NCP, NCPVPC, NHNCLOUD, KTCLOUD, KTVPC] request for region, zone list and Spec/image test set information HOT 3
- Umbrella: Support seamless K8s cluster provisioning HOT 2
- Check Docker image works for CB-TB v0.8.8 and latest main HOT 2
- Fail to create the virtual environment when python venv module is available HOT 2
- It needs more detail message for debugging when registering ConnConfig by init.sh HOT 5
- How to debug this panic, that is "[PANIC RECOVER] interface conversion: interface {} is nil, not int"?
- Report that abnormal log appears when creating MCIS HOT 1
- Support configuration for seamless K8s cluster provisioning HOT 11
- [NCPVPC] MCIS Dynamic provisioning failure with unexpected behavior HOT 7
- Need in-detail subnet information
- K8s cluster provisioning process based on CB-MapUI HOT 2
- Extend options to specify `Hold` target and step for MCIS provisioning HOT 2
- In the case of CSPs where region/zone names are written in uppercase letters, an error occurs because the cloud resource name or connection name includes uppercase letters.. HOT 2
- Provide operationId to API docs for each API command
- Typographical Errors in `provisioning.go` HOT 2
- System default sshkey resource can be removed by rollback from another mcis provisioning
- cb-spider recognition failure error in docker-compose environment HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cb-tumblebug.