Giter Site home page Giter Site logo

Comments (8)

seokho-son avatar seokho-son commented on June 12, 2024
// 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.

seokho-son avatar seokho-son commented on June 12, 2024

// 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.

seokho-son avatar seokho-son commented on June 12, 2024
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.

seokho-son avatar seokho-son commented on June 12, 2024

VM이 많이 포함된 MCIS에서,

내부 VM 정보를 삭제하면,

MCIS 상태 조회 기능에서 오류 발생 가능.

MCIS 상태 조회는 기본적으로 MCIS에 포함된 VM 리스트를 조회하여,
개별 VM에 대해 상태 조회를 하고 MCIS 오브젝트의 정보를 업데이트하는데,

MCIS 상태 조회가 길어지면,
처음 조회하여 가지고 있던 VM list의 수가 상태 조회 중에 변경될 가능성 높음. (VM 삭제 등의 요청 발생하는 경우)

결과적으로는 없는 VM에 대한 처리 요청이 발생할 수 있으며,
에러처리가 잘 안되어 있는 부분에서 nil reference error 및 panic이 발생하는 것으로 추측.

from cb-tumblebug.

seokho-son avatar seokho-son commented on June 12, 2024

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.

seokho-son avatar seokho-son commented on June 12, 2024

미봉책: 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.

seokho-son avatar seokho-son commented on June 12, 2024

https://yongho1037.tistory.com/815

from cb-tumblebug.

seokho-son avatar seokho-son commented on June 12, 2024

고루틴 버퍼드 채널 사용 또는
Rate 제한도 방안이 될 수 있음.

https://dev.to/godoylucase/rate-limiting-your-goroutines-1om1

from cb-tumblebug.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.