mesos / mesos-go

Go language bindings for Apache Mesos
Apache License 2.0
545 stars 146 forks source link

support for quota, allocator, maintenance, master, and agent v1.2.x APIs #312

Closed jdef closed 6 years ago

jdef commented 7 years ago
jdef commented 7 years ago

make test fails for me because of some GoString related test. Suspect a bug in gogo/protobuf. I hacked the test to output the result of the GoString func that failed to parse:

--- FAIL: TestEvent_TaskUpdatedGoString (0.00s)
        masterpb_test.go:7963: failed to parse &master.Event_TaskUpdated{FrameworkID: mesos.FrameworkID{Value: "CW0R6JWXGjhG3m3pAnAbJV0jG7DTCYQvCekLB5zY0FxUZa6N8JzsTMxQyffu",
                },
                Status: mesos.TaskStatus{TaskID: mesos.TaskID{Value: "0g2LMJZn5Nmp9rhboWMBvMfvJDMEGJ0q4UpS5tjBVCB3FuDclnFoTG3HsJH57ufYnZ3nQzz7COA4",
                },
                State: func(v mesos.TaskState) *mesos.TaskState { return &v } ( 5 ),
                Message: func(v string) *string { return &v } ( "6G44Yqd" ),
                Source: func(v mesos.TaskStatus_Source) *mesos.TaskStatus_Source { return &v } ( 1 ),
                Reason: func(v mesos.TaskStatus_Reason) *mesos.TaskStatus_Reason { return &v } ( 20 ),
                ExecutorID: &mesos.ExecutorID{Value: "FlRaWodJlx61RG5k3NjbS3bOFGFKiqvR4R8yWOdRMkgJNmbQ9BhtGXEIHOw",
                },
                Timestamp: func(v float64) *float64 { return &v } ( 0.1795823327242275 ),
                Healthy: func(v bool) *bool { return &v } ( false ),
                CheckStatus: &mesos.CheckStatusInfo{Type: func(v mesos.CheckInfo_Type) *mesos.CheckInfo_Type { return &v } ( 2 ),
                Command: &mesos.CheckStatusInfo_Command{ExitCode: func(v int32) *int32 { return &v } ( -69695686 ),
                },
                HTTP: &mesos.CheckStatusInfo_Http{StatusCode: func(v uint32) *uint32 { return &v } ( 0x95f985dc ),
                },
                },
                Labels: &mesos.Labels{Labels: []mesos.Label{mesos.Label{Key:"tBGAfISwYn3XJusiJitNyQSZlnTBg", Value:(*string)(0xc42015c600)}, mesos.Label{Key:"EiJHST1g4QWQeYDPGaCHmsPtRzq27ZMznvMLGfoQd20c9oLC5i2UqDi
mc8oPnI3nhWFvzK1ui", Value:(*string)(0xc42015c620)}, mesos.Label{Key:"qPSxKCnx1UW6uSjUkeaBkK", Value:(*string)(0xc42015c630)}, mesos.Label{Key:"tydcu0owgtFNChnDhlO95bjonwijuOkcqsBY2ZmS0rWcLdQNce8D4qWompMDeHrStSkgC
JpBKEa", Value:(*string)(0xc42015c640)}},
                },
                UnreachableTime: &mesos.TimeInfo{Nanoseconds: -5095539703890242531,
                },
                },
                State: func(v master.mesos.TaskState) *master.mesos.TaskState { return &v } ( 1 ),
                }
panic: 24:8: expected expression (and 3 more errors) [recovered]   
        panic: 24:8: expected expression (and 3 more errors)

goroutine 341 [running]:
testing.tRunner.func1(0xc42014d6c0)
        /usr/local/go-1.8.1/src/testing/testing.go:622 +0x55f
panic(0xc50620, 0xc4203ff320)
        /usr/local/go-1.8.1/src/runtime/panic.go:489 +0x2f0
github.com/mesos/mesos-go/api/v1/lib/master.TestEvent_TaskUpdatedGoString(0xc42014d6c0)
        /home/vagrant/mesos-go-workspace/src/github.com/mesos/mesos-go/api/v1/lib/master/masterpb_test.go:7964 +0x517
testing.tRunner(0xc42014d6c0, 0xcb4db0)
        /usr/local/go-1.8.1/src/testing/testing.go:657 +0x108
created by testing.(*T).Run
        /usr/local/go-1.8.1/src/testing/testing.go:697 +0x544
FAIL    github.com/mesos/mesos-go/api/v1/lib/master     4.348s

The (generated, then hacked) test case is:

func TestEvent_TaskUpdatedGoString(t *testing.T) {
        popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano()))
        p := NewPopulatedEvent_TaskUpdated(popr, false)
        s1 := p.GoString()
        s2 := fmt.Sprintf("%#v", p)
        if s1 != s2 {
                t.Fatalf("GoString want %v got %v", s1, s2)
        }
        _, err := go_parser.ParseExpr(s1)
        if err != nil {
                t.Errorf("failed to parse %s", s1) // I added this to see what GoString was returning
                panic(err) // fails the test
        }
}
coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 52.609% when pulling 179cbce3f4fee5950addef1d1968c4f1bf6a7b0c on jdef_master_v1_api_support into 464c8d6a7d891b5f7695e6a6e78c6e3974223db4 on master.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 52.609% when pulling 5df56f4ac6c055669a0f0198c6aaf3ee08c32452 on jdef_master_v1_api_support into 464c8d6a7d891b5f7695e6a6e78c6e3974223db4 on master.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 52.609% when pulling c82e1af5a7412be4f4ac1ec4a556cf6f0059fe2c on jdef_master_v1_api_support into 464c8d6a7d891b5f7695e6a6e78c6e3974223db4 on master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-2.0%) to 50.618% when pulling 6b613994194527eaf7620a1676a6a654d483573e on jdef_master_v1_api_support into 464c8d6a7d891b5f7695e6a6e78c6e3974223db4 on master.

jdef commented 7 years ago

I've been testing the "attach container" API with an interactive bash shell. Couple of problems observed so far:

  1. when running msh without the -pod flag bash generates warnings at startup

    2017/08/30 20:18:57 status update from agent "4849630d-c04b-4ae5-9659-9f40aeab5fd2-S0": TASK_RUNNING
    2017/08/30 20:18:57 attaching for interactive session to agent "4849630d-c04b-4ae5-9659-9f40aeab5fd2-S0" container "d340b90d-d733-4c67-b909-67a0488759e7"
    original window size is 213 x 48
    bash: cannot set terminal process group (-1): Inappropriate ioctl for device
    bash: no job control in this shell
  2. intermittent task (I/O switchboard) failures when attaching to the container (several related logs follow, ignore the tiimestamp skew - logs were sampled from several test runs. the errors are the same across failed runs)

    2017/08/30 20:15:05 status update from agent "4849630d-c04b-4ae5-9659-9f40aeab5fd2-S1": TASK_RUNNING
    2017/08/30 20:15:05 attaching for interactive session to agent "4849630d-c04b-4ae5-9659-9f40aeab5fd2-S1" container "9f9d833f-ff32-4943-a397-f2eba78b4448"
    original window size is 213 x 48
    2017/08/30 20:15:05 attached input stream error Post http://10.2.0.5:5051/api/v1: context canceled
    2017/08/30 20:15:05 Exiting because task 20170830T201505Z is in an unexpected state TASK_FAILED with reason REASON_COMMAND_EXECUTOR_FAILED from source SOURCE_EXECUTOR with message 'Command terminated with signal Window changed'
    2017/08/30 20:15:05 exit code 3

    slave logs:

    E0830 18:46:35.124127  2119 switchboard.cpp:902] Unexpected termination of I/O switchboard server: 'IOSwitchboard' exited with status 1 for container 24a90359-b0e4-4c0a-9051-e6552811ae22.9ad1023b-cb7a-45fc-8053-dc
    a0e888c9d3

    container stderr:

    $ cat /var/lib/mesos/slaves/4849630d-c04b-4ae5-9659-9f40aeab5fd2-S1/frameworks/93c06854-b91a-4f8d-86b4-cdf1cc628613-0101/executors/msh_20170830T184634Z/runs/latest/containers/9ad1023b-cb7a-45fc-8053-dca0e888c9d3/stderr 
    The io switchboard server failed: Failed redirecting stdout: Input/output error

    container stdout:

    $ cat /var/lib/mesos/slaves/4849630d-c04b-4ae5-9659-9f40aeab5fd2-S1/frameworks/93c06854-b91a-4f8d-86b4-cdf1cc628613-0101/executors/msh_20170830T184634Z/runs/latest/containers/9ad1023b-cb7a-45fc-8053-dca0e888c9d3/stdout
    Executing pre-exec command '{"arguments":["mesos-containerizer","mount","--help=false","--operation=make-rslave","--path=\/"],"shell":false,"value":"\/usr\/libexec\/mesos\/mesos-containerizer"}'

There are (currently) a number of open MESOS tickets related to container attachment: https://issues.apache.org/jira/browse/MESOS-7103

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-2.6%) to 50.048% when pulling 8cd48c5ec6de3b444ab3680690c285f1a3e80edb on jdef_master_v1_api_support into 464c8d6a7d891b5f7695e6a6e78c6e3974223db4 on master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-4.6%) to 48.032% when pulling 8390a8110e141dd84318cdaab49bba136805ca26 on jdef_master_v1_api_support into 464c8d6a7d891b5f7695e6a6e78c6e3974223db4 on master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-4.6%) to 48.054% when pulling 50ae4e04982a9f972d23ffd97e0a06a10ed41e30 on jdef_master_v1_api_support into 464c8d6a7d891b5f7695e6a6e78c6e3974223db4 on master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-7.8%) to 44.853% when pulling c908bd8c051cac96e55c1a82fb8c79a5bf572689 on jdef_master_v1_api_support into 464c8d6a7d891b5f7695e6a6e78c6e3974223db4 on master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-3.1%) to 49.495% when pulling f777f1bcbec9f37c733e1eb6a73e9843d229d4cd on jdef_master_v1_api_support into 464c8d6a7d891b5f7695e6a6e78c6e3974223db4 on master.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+0.4%) to 52.989% when pulling 1bedc2af73574491bd47412debf5408878de82d5 on jdef_master_v1_api_support into 464c8d6a7d891b5f7695e6a6e78c6e3974223db4 on master.

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-0.08%) to 52.527% when pulling 1bedc2af73574491bd47412debf5408878de82d5 on jdef_master_v1_api_support into 464c8d6a7d891b5f7695e6a6e78c6e3974223db4 on master.

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-0.008%) to 52.602% when pulling a0887937a5d3d1217b6089209a5386471aa89e36 on jdef_master_v1_api_support into 464c8d6a7d891b5f7695e6a6e78c6e3974223db4 on master.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+1.3%) to 53.897% when pulling 848347f687a5d197bfa6d38539f28cf6785f7dec on jdef_master_v1_api_support into 464c8d6a7d891b5f7695e6a6e78c6e3974223db4 on master.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+1.7%) to 54.172% when pulling 4c21684694edc7d476e290f8455a035ec0b57fb7 on jdef_master_v1_api_support into 479884c671ca295dd2329589617dd4a96a26591a on master.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+1.7%) to 54.172% when pulling 14d08b2d782d7d2f5a74d6acd669ed8148c7c4ec on jdef_master_v1_api_support into 479884c671ca295dd2329589617dd4a96a26591a on master.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+3.2%) to 55.718% when pulling 2a8c4c45f446071ccf3fac9c24920b425b3dde60 on jdef_master_v1_api_support into 479884c671ca295dd2329589617dd4a96a26591a on master.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+3.4%) to 55.887% when pulling 6329032f7a9fa7e2fff99cf3731c4e411a27aaf0 on jdef_master_v1_api_support into 479884c671ca295dd2329589617dd4a96a26591a on master.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+4.6%) to 57.067% when pulling 93a08911a438ffa3ff0643a587cdc233a46b1109 on jdef_master_v1_api_support into 479884c671ca295dd2329589617dd4a96a26591a on master.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+4.6%) to 57.067% when pulling e6802a2c976213d3bf4b0db4b9e5e34ca717f673 on jdef_master_v1_api_support into 479884c671ca295dd2329589617dd4a96a26591a on master.