Giter Site home page Giter Site logo

playnet-public / gorcon Goto Github PK

View Code? Open in Web Editor NEW
11.0 11.0 1.0 12.02 MB

GoRcon is an abstraction layer to map common rcon functionality from various games to a unified api (grpc/rest) while also providing local management functionality to make running game servers easier. This allows the use as a rcon connector for both client tools and cloud solutions like the PlayNet BanList.

License: GNU General Public License v3.0

Makefile 6.76% Go 93.24%
arma3 battleye gameserver gaming golang grpc minecraft opensource rcon rcon-client rcon-connection rcon-console rest rust valve

gorcon's People

Contributors

kwiesmueller avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

the-locksmith

gorcon's Issues

Implement Internal API Mesh

gorcon consists of a notable amount of internal parts that need to communicate with each other in order to carry out the main task of managing a game server.
To keep those parts as abstract and general as possible without directly linking them, we need some kind of internal API for them to communicate.

This is the foundation for offering both the rpc based cli interaction as well as external gRPC/HTTP based control of gorcon's functionality through web interfaces and services.

The internal API basically would require a way for all those parts inside gorcon to register their functionality with it and then expose invocation through it.
This means, the API needs to be as general as our services are and offer some kind of internal access path to make finding the required services possible.

In a final state, all functionality should be executed through this channel and after initialization every part of gorcon should solely be called through the API.

Acceptance Criteria:

  • Internal API Service for
    • Registering Functions to be called by other services inside gorcon
    • Calling Functions previously registered via their known access path
    • Plug-ability for rpc/gRPC and REST Mappers to later expose this internal API to external services

Open Questions:

  • Final API Architecture and Design
  • Choice of Implementation (Event Driven?, Sync?, Channels?)
  • How to map registered functions
  • How to find mapped functions

Steps to the final vision:

To reach the final vision, several reference implementations and experiments might be required. Without trying out several approaches no informed decision can be concluded.
Therefor the suggestion might be to first implement a very basic API Service which get's handed all services it is able to call as pointers and then use this Service inside other parts of gorcon like the cli interface. This way we might get a working implementation at least in some way representing what we need, while keeping it decoupled from other services as well as possible.
This would already be a huge improvement to gorcon-arma which required the used services to provide special functions for exposing them to e.g. the scheduler.

This issue might be subject to further discussion and radical changes in the near future.

Fix deadlocks inside watcher and battleye subscription tests

While it is still not 100% clear if those deadlocks randomly appearing when testing battleye and watcher, those definitely have to go for good.

The locks are related to the subscription code responsible for adding subscribers and removing them on closed context. This is surrounded by heavy use of RWMutexes and go routines making it quite complex (maybe more complex than necessary).

It would be good to revise and overthink the entire implementation, debug it or possibly rewrite it as a whole.

The subscription model seems valuable and should stick with both battleye and the watcher as it is key for being that plugable in our internal API, but the problems seen here urgently need to be resolved.

Implement Scheduler

gorcon should offer an easy way to schedule recurring or single time events to be enacted on different parts of the gorcon application.
Some examples of this are

  • (re)starting the server
  • executing rcon commands
  • changing settings
  • sending data via other services

To implement this, all available functions for this first need to be generally available through one dedicated internal channel. Therefor implementing of this issue highly relies onto #3 and is mostly blocked by it.

Nevertheless the scheduler functionality can already be outlined.
Acceptance Criteria:

  • A comprehensible format for defining and storing said schedule
  • A dynamic and general way to store, change and handle the stored schedule according to gorcon's overall architecture
    This includes the ability to update the schedule at runtime, access it from several ends (api, etc.) and persist those changes in a reasonable manner.
  • Access to the full set of internal API's offering full flexibility in working with gorcon

Implement Watcher

Key part of gorcon is to start and manage a games process and restart it if necessary.
This functionality is placed under the internal name "watcher" as the job of this package is to watch a process and monitor it's state implying actions on special events (which might also be external commands).

Implementation of this package should be very generic as usual and offer key functionality for starters.
This means opening an interface for starting, stopping and keeping processes alive.

Acceptance Criteria:

  • Well defined and designed public API for
    • Starting a process
    • Keeping a process alive
    • Stopping a process
    • Subscribing event listeners for process output
  • Functional passing on of context down the action tree for logging, tracing, etc.

Due to the general approach we follow with gorcon, event subscriptions should be handled by channels broadcasting all received process events to the subscribers.
This allows us to attach any kind of listener and allow them to act based on those events through the public API exposed by the watcher.

Implement CLI

Interaction with gorcon should be diverse and functional.
The project is not meant as a simple service delivered, configured and set running but as a full fledged solution for managing game servers.

This means, we require a sufficient way of accessing internal functionality through external interfaces, a well designed CLI being one of them.

Implementing this is blocked by #3 to offer the internal API first hand and use it with the CLI in the next step.
The CLI should be part of the gorcon binary, so no further tools are required. The user should be able to start gorcon with a single command (or as a service) and then access it through successive commands using the same binary.
This allows pretty intuitive usage of our tool and enables easy setup and change through intuitive and well known interaction.

Communication with the main process should take place through the (g)RPC API offered by #3 or the external API (skipping auth for local interaction).

For designing the client/server architecture Protobufs, gRPC and Cobra might come handy.

Acceptance Criteria:

  • A well designed approach to CLI layout and functionality
  • Use of the general API provided internally

Debug data race in battleye test

 kwiesmueller@asset001  ~/go/src/github.com/playnet-public/gorcon   master ●  make test
[1526254537] GoRcon Suite - 0/0 specs  SUCCESS! 163.3µs PASS
coverage: 0.0% of statements
[1526254537] Rcon Suite - 19/19 specs ••••••••••••••••••• SUCCESS! 1.179201ms PASS
coverage: 100.0% of statements
[1526254537] BattlEye Suite - 31/31 specs •••••••••••••••••••••••••==================
WARNING: DATA RACE
Write at 0x00c4201781a8 by goroutine 8:
  github.com/playnet-public/gorcon/pkg/rcon/battleye_test.glob..func2.5.3()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/pkg/rcon/battleye/battleye_test.go:194 +0x5f
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/leafnodes.(*runner).runSync()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/leafnodes/runner.go:109 +0xbb
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/leafnodes.(*runner).run()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/leafnodes/runner.go:63 +0x17a
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/leafnodes.(*ItNode).Run()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/leafnodes/it_node.go:25 +0xa0
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/spec.(*Spec).runSample()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/spec/spec.go:176 +0x741
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/spec.(*Spec).Run()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/spec/spec.go:127 +0x112
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/specrunner.(*SpecRunner).runSpec()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/specrunner/spec_runner.go:198 +0x173
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/specrunner.(*SpecRunner).runSpecs()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/specrunner/spec_runner.go:168 +0x5f7
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/specrunner.(*SpecRunner).Run()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/specrunner/spec_runner.go:64 +0x103
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/suite.(*Suite).Run()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/suite/suite.go:62 +0x3b9
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo.RunSpecsWithCustomReporters()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/ginkgo_dsl.go:218 +0x310
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo.RunSpecs()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/ginkgo_dsl.go:199 +0xc1
  github.com/playnet-public/gorcon/pkg/rcon/battleye_test.TestBattlEye()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/pkg/rcon/battleye/battleye_test.go:24 +0x85
  testing.tRunner()
      /usr/lib/go/src/testing/testing.go:777 +0x16d

Previous read at 0x00c4201781a8 by goroutine 48:
  github.com/playnet-public/gorcon/pkg/rcon/battleye.(*Connection).ReaderLoop()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/pkg/rcon/battleye/battleye.go:143 +0xf4
  github.com/playnet-public/gorcon/pkg/rcon/battleye.(*Connection).ReaderLoop-fm()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/pkg/rcon/battleye/battleye.go:115 +0x41
  github.com/playnet-public/gorcon/vendor/gopkg.in/tomb%2ev2.(*Tomb).run()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/gopkg.in/tomb.v2/tomb.go:163 +0x38

Goroutine 8 (running) created at:
  testing.(*T).Run()
      /usr/lib/go/src/testing/testing.go:824 +0x564
  testing.runTests.func1()
      /usr/lib/go/src/testing/testing.go:1063 +0xa4
  testing.tRunner()
      /usr/lib/go/src/testing/testing.go:777 +0x16d
  testing.runTests()
      /usr/lib/go/src/testing/testing.go:1061 +0x4e1
  testing.(*M).Run()
      /usr/lib/go/src/testing/testing.go:978 +0x2cd
  main.main()
      _testmain.go:92 +0x324

Goroutine 48 (running) created at:
  github.com/playnet-public/gorcon/vendor/gopkg.in/tomb%2ev2.(*Tomb).Go()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/gopkg.in/tomb.v2/tomb.go:159 +0x11b
  github.com/playnet-public/gorcon/pkg/rcon/battleye.(*Connection).Hold()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/pkg/rcon/battleye/battleye.go:115 +0x15a
  github.com/playnet-public/gorcon/pkg/rcon/battleye_test.glob..func2.5.1()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/pkg/rcon/battleye/battleye_test.go:188 +0xc7
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/leafnodes.(*runner).runSync()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/leafnodes/runner.go:109 +0xbb
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/leafnodes.(*runner).run()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/leafnodes/runner.go:63 +0x17a
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/leafnodes.(*SetupNode).Run()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/leafnodes/setup_nodes.go:14 +0xa0
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/spec.(*Spec).runSample()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/spec/spec.go:158 +0x25e
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/spec.(*Spec).Run()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/spec/spec.go:127 +0x112
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/specrunner.(*SpecRunner).runSpec()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/specrunner/spec_runner.go:198 +0x173
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/specrunner.(*SpecRunner).runSpecs()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/specrunner/spec_runner.go:168 +0x5f7
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/specrunner.(*SpecRunner).Run()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/specrunner/spec_runner.go:64 +0x103
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/suite.(*Suite).Run()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/suite/suite.go:62 +0x3b9
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo.RunSpecsWithCustomReporters()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/ginkgo_dsl.go:218 +0x310
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo.RunSpecs()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/ginkgo_dsl.go:199 +0xc1
  github.com/playnet-public/gorcon/pkg/rcon/battleye_test.TestBattlEye()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/pkg/rcon/battleye/battleye_test.go:24 +0x85
  testing.tRunner()
      /usr/lib/go/src/testing/testing.go:777 +0x16d
==================
==================
WARNING: DATA RACE
Read at 0x00c4201781a8 by goroutine 48:
  github.com/playnet-public/gorcon/pkg/rcon/battleye.(*Connection).ReaderLoop()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/pkg/rcon/battleye/battleye.go:145 +0x16f
  github.com/playnet-public/gorcon/pkg/rcon/battleye.(*Connection).ReaderLoop-fm()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/pkg/rcon/battleye/battleye.go:115 +0x41
  github.com/playnet-public/gorcon/vendor/gopkg.in/tomb%2ev2.(*Tomb).run()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/gopkg.in/tomb.v2/tomb.go:163 +0x38

Previous write at 0x00c4201781a8 by goroutine 8:
  github.com/playnet-public/gorcon/pkg/rcon/battleye_test.glob..func2.5.3()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/pkg/rcon/battleye/battleye_test.go:194 +0x5f
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/leafnodes.(*runner).runSync()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/leafnodes/runner.go:109 +0xbb
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/leafnodes.(*runner).run()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/leafnodes/runner.go:63 +0x17a
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/leafnodes.(*ItNode).Run()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/leafnodes/it_node.go:25 +0xa0
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/spec.(*Spec).runSample()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/spec/spec.go:176 +0x741
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/spec.(*Spec).Run()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/spec/spec.go:127 +0x112
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/specrunner.(*SpecRunner).runSpec()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/specrunner/spec_runner.go:198 +0x173
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/specrunner.(*SpecRunner).runSpecs()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/specrunner/spec_runner.go:168 +0x5f7
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/specrunner.(*SpecRunner).Run()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/specrunner/spec_runner.go:64 +0x103
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/suite.(*Suite).Run()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/suite/suite.go:62 +0x3b9
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo.RunSpecsWithCustomReporters()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/ginkgo_dsl.go:218 +0x310
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo.RunSpecs()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/ginkgo_dsl.go:199 +0xc1
  github.com/playnet-public/gorcon/pkg/rcon/battleye_test.TestBattlEye()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/pkg/rcon/battleye/battleye_test.go:24 +0x85
  testing.tRunner()
      /usr/lib/go/src/testing/testing.go:777 +0x16d

Goroutine 48 (running) created at:
  github.com/playnet-public/gorcon/vendor/gopkg.in/tomb%2ev2.(*Tomb).Go()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/gopkg.in/tomb.v2/tomb.go:159 +0x11b
  github.com/playnet-public/gorcon/pkg/rcon/battleye.(*Connection).Hold()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/pkg/rcon/battleye/battleye.go:115 +0x15a
  github.com/playnet-public/gorcon/pkg/rcon/battleye_test.glob..func2.5.1()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/pkg/rcon/battleye/battleye_test.go:188 +0xc7
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/leafnodes.(*runner).runSync()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/leafnodes/runner.go:109 +0xbb
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/leafnodes.(*runner).run()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/leafnodes/runner.go:63 +0x17a
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/leafnodes.(*SetupNode).Run()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/leafnodes/setup_nodes.go:14 +0xa0
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/spec.(*Spec).runSample()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/spec/spec.go:158 +0x25e
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/spec.(*Spec).Run()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/spec/spec.go:127 +0x112
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/specrunner.(*SpecRunner).runSpec()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/specrunner/spec_runner.go:198 +0x173
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/specrunner.(*SpecRunner).runSpecs()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/specrunner/spec_runner.go:168 +0x5f7
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/specrunner.(*SpecRunner).Run()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/specrunner/spec_runner.go:64 +0x103
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/suite.(*Suite).Run()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/suite/suite.go:62 +0x3b9
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo.RunSpecsWithCustomReporters()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/ginkgo_dsl.go:218 +0x310
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo.RunSpecs()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/ginkgo_dsl.go:199 +0xc1
  github.com/playnet-public/gorcon/pkg/rcon/battleye_test.TestBattlEye()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/pkg/rcon/battleye/battleye_test.go:24 +0x85
  testing.tRunner()
      /usr/lib/go/src/testing/testing.go:777 +0x16d

Goroutine 8 (running) created at:
  testing.(*T).Run()
      /usr/lib/go/src/testing/testing.go:824 +0x564
  testing.runTests.func1()
      /usr/lib/go/src/testing/testing.go:1063 +0xa4
  testing.tRunner()
      /usr/lib/go/src/testing/testing.go:777 +0x16d
  testing.runTests()
      /usr/lib/go/src/testing/testing.go:1061 +0x4e1
  testing.(*M).Run()
      /usr/lib/go/src/testing/testing.go:978 +0x2cd
  main.main()
      _testmain.go:92 +0x324
==================
==================
WARNING: DATA RACE
Read at 0x00c4201781a8 by goroutine 47:
  github.com/playnet-public/gorcon/pkg/rcon/battleye.(*Connection).WriterLoop()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/pkg/rcon/battleye/battleye.go:125 +0x25f
  github.com/playnet-public/gorcon/pkg/rcon/battleye.(*Connection).WriterLoop-fm()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/pkg/rcon/battleye/battleye.go:114 +0x41
  github.com/playnet-public/gorcon/vendor/gopkg.in/tomb%2ev2.(*Tomb).run()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/gopkg.in/tomb.v2/tomb.go:163 +0x38

Previous write at 0x00c4201781a8 by goroutine 8:
  github.com/playnet-public/gorcon/pkg/rcon/battleye_test.glob..func2.5.3()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/pkg/rcon/battleye/battleye_test.go:194 +0x5f
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/leafnodes.(*runner).runSync()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/leafnodes/runner.go:109 +0xbb
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/leafnodes.(*runner).run()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/leafnodes/runner.go:63 +0x17a
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/leafnodes.(*ItNode).Run()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/leafnodes/it_node.go:25 +0xa0
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/spec.(*Spec).runSample()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/spec/spec.go:176 +0x741
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/spec.(*Spec).Run()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/spec/spec.go:127 +0x112
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/specrunner.(*SpecRunner).runSpec()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/specrunner/spec_runner.go:198 +0x173
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/specrunner.(*SpecRunner).runSpecs()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/specrunner/spec_runner.go:168 +0x5f7
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/specrunner.(*SpecRunner).Run()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/specrunner/spec_runner.go:64 +0x103
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/suite.(*Suite).Run()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/suite/suite.go:62 +0x3b9
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo.RunSpecsWithCustomReporters()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/ginkgo_dsl.go:218 +0x310
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo.RunSpecs()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/ginkgo_dsl.go:199 +0xc1
  github.com/playnet-public/gorcon/pkg/rcon/battleye_test.TestBattlEye()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/pkg/rcon/battleye/battleye_test.go:24 +0x85
  testing.tRunner()
      /usr/lib/go/src/testing/testing.go:777 +0x16d

Goroutine 47 (running) created at:
  github.com/playnet-public/gorcon/vendor/gopkg.in/tomb%2ev2.(*Tomb).Go()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/gopkg.in/tomb.v2/tomb.go:159 +0x11b
  github.com/playnet-public/gorcon/pkg/rcon/battleye.(*Connection).Hold()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/pkg/rcon/battleye/battleye.go:114 +0xd4
  github.com/playnet-public/gorcon/pkg/rcon/battleye_test.glob..func2.5.1()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/pkg/rcon/battleye/battleye_test.go:188 +0xc7
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/leafnodes.(*runner).runSync()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/leafnodes/runner.go:109 +0xbb
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/leafnodes.(*runner).run()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/leafnodes/runner.go:63 +0x17a
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/leafnodes.(*SetupNode).Run()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/leafnodes/setup_nodes.go:14 +0xa0
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/spec.(*Spec).runSample()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/spec/spec.go:158 +0x25e
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/spec.(*Spec).Run()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/spec/spec.go:127 +0x112
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/specrunner.(*SpecRunner).runSpec()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/specrunner/spec_runner.go:198 +0x173
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/specrunner.(*SpecRunner).runSpecs()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/specrunner/spec_runner.go:168 +0x5f7
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/specrunner.(*SpecRunner).Run()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/specrunner/spec_runner.go:64 +0x103
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/suite.(*Suite).Run()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/internal/suite/suite.go:62 +0x3b9
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo.RunSpecsWithCustomReporters()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/ginkgo_dsl.go:218 +0x310
  github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo.RunSpecs()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/github.com/onsi/ginkgo/ginkgo_dsl.go:199 +0xc1
  github.com/playnet-public/gorcon/pkg/rcon/battleye_test.TestBattlEye()
      /home/kwiesmueller/go/src/github.com/playnet-public/gorcon/pkg/rcon/battleye/battleye_test.go:24 +0x85
  testing.tRunner()
      /usr/lib/go/src/testing/testing.go:777 +0x16d

Goroutine 8 (running) created at:
  testing.(*T).Run()
      /usr/lib/go/src/testing/testing.go:824 +0x564
  testing.runTests.func1()
      /usr/lib/go/src/testing/testing.go:1063 +0xa4
  testing.tRunner()
      /usr/lib/go/src/testing/testing.go:777 +0x16d
  testing.runTests()
      /usr/lib/go/src/testing/testing.go:1061 +0x4e1
  testing.(*M).Run()
      /usr/lib/go/src/testing/testing.go:978 +0x2cd
  main.main()
      _testmain.go:92 +0x324
==================
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x643170]

goroutine 73 [running]:
github.com/playnet-public/gorcon/pkg/rcon/battleye.(*Connection).ReaderLoop(0xc420178180, 0x0, 0x0)
	/home/kwiesmueller/go/src/github.com/playnet-public/gorcon/pkg/rcon/battleye/battleye.go:145 +0x180
github.com/playnet-public/gorcon/pkg/rcon/battleye.(*Connection).ReaderLoop-fm(0x4889f1, 0x0)
	/home/kwiesmueller/go/src/github.com/playnet-public/gorcon/pkg/rcon/battleye/battleye.go:115 +0x42
github.com/playnet-public/gorcon/vendor/gopkg.in/tomb%2ev2.(*Tomb).run(0xc4200a60f0, 0xc42ef5c090)
	/home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/gopkg.in/tomb.v2/tomb.go:163 +0x39
created by github.com/playnet-public/gorcon/vendor/gopkg.in/tomb%2ev2.(*Tomb).Go
	/home/kwiesmueller/go/src/github.com/playnet-public/gorcon/vendor/gopkg.in/tomb.v2/tomb.go:159 +0x11c

Ginkgo ran 3 suites in 5.993418645s
Test Suite Failed
make: *** [Makefile:62: test] Error 1

Implement Internal Persistence and Configuration

As already outlined in #5 , #3 and #4 configuration and other persistent data inside gorcon should be available at any time for any service.
Going even further #5 outlines the fact, that starting the binary itself should already offer a barebone gorcon mode open for setup through the CLI or API which has to result in some kind of config being stored to keep functionality over restarts.

This requires us to build some kind of internal persistence layer for storing and accessing both configs and other data and also allowing change at runtime with potentially immediate impact on other services.

One pretty good example for this is the internal LogLevel. In an ideal implementation it would be possible to change the LogLevel at any time and see immediate impact.
While this feature might be limited through our use of zap for doing logging, it is a good example.
Other examples are adding scheduler events or updating them on the fly.

The exact design of this feature is not decided yet, all that is clear for now is it's importance for our final vision.
References might be found inside the traefik project which already uses consul/etcd for comparable features.

Acceptance Criteria:

  • Dynamic persistence for configs and data inside the entire application
  • Accessible by every part of gorcon at any time
  • Potential to enact and distribute changes to configs and data at realtime

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.