rolandweber / Pityoulish

A collection of programming/debugging exercises to support a course on Distributed Systems.
Creative Commons Zero v1.0 Universal
7 stars 0 forks source link

Less logging output for Follow-the-Board connections #88

Closed rolandweber closed 4 years ago

rolandweber commented 5 years ago

During the classroom exercise, it would be helpful if the connections from the "Follow the Board" client on the instructor's machine would not be logged, or at least less verbose.

While developing, or when students run the server on their own machines, connections from the same machine should not be treated differently though. Check an environment variable? Or evaluate an optional command-line argument?

rolandweber commented 5 years ago

Could I detect local connections for RMI as well, using RemoteServer.getClientHost()? With that, I could also prevent issuing of multiple tokens to the same client machine :-)

rolandweber commented 4 years ago

In an online setting, everyone might be running a follow-the-board client, see #97. I could use a magic number for the maximum batch size to reduce logging.

rolandweber commented 4 years ago

The Sockets server prints three messages for each request from the FTB client:

SimplisticSocketHandler: MBSS013: Connection from /127.0.0.1:58286.
MBSS023: Received LIST_MESSAGES from /127.0.0.1.
MBSS026: Returning 2 with marker "Oy".

The magic batch size works for the latter two. The first one is printed before the request data is received.

For the remote exercise, I'd have to jump through hoops to distinguish FTB clients from others. I could bind the FTB clients to a specific port and check that on the server. Sounds unreasonable. Reasonably, either print messages about all connections, or about none. Printing only the first one from each client IP would not be helpful. If students are running FTB clients, they wouldn't get connection reports for the client they're debugging.

rolandweber commented 4 years ago

How about setting an environment variable to enable/disable printing of connections? Default is to print, use a setting in the pod yaml to disable.

Even simpler: let the Main class for the pod set the behavior to silent.