Skip to content

Instantly share code, notes, and snippets.

arung cloudbow

Block or report user

Report or block cloudbow

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@cloudbow
cloudbow / gunicorn_relaod
Last active Sep 30, 2019
Gunicorn reload not working
View gunicorn_relaod
# Introduction
I have created a Dockerfile which solves the problem of Gunicorn not doing relaods. It just needs the inotify tools as well as the
pip module. This solves the problem of reloading the fullstack couchbase python in PyCharm.
```
FROM tiangolo/uvicorn-gunicorn:python3.7
LABEL maintainer="Arun George <arun.georg@xyz.com>"
# Dependencies for Couchbase
View .gitignore
# exclude patterns (uncomment them if you want to use them):
# *.[oa]
# *~
# idea:
*.iml
*.ipr
*.iws
.idea/
# maven:
target/
View gist:51a32fd2b1266911947f
package apns.netty.queues.single;
import io.netty.channel.Channel;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelFutureListener;
import javax.annotation.PreDestroy;
import org.apache.log4j.Logger;
@cloudbow
cloudbow / gist:92e17c49e538a45c9044
Created Jul 10, 2014
ApnsMessageStatsSysLogger
View gist:92e17c49e538a45c9044
/**
*
*/
package apns.netty.syslog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
/**
View gist:9513536
package gcm.netty.handlers;
import gcm.netty.codec.GcmBatchMessageEncoder;
import gcm.netty.config.GcmConfig;
import gcm.netty.constants.GcmProtocolConstants;
import gcm.netty.constants.TraceLogs;
import gcm.netty.security.GcmSSLContextFactory;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
View gist:9513470
package gcm.netty.handlers;
import gcm.netty.constants.ApplicationContextComponents;
import gcm.netty.constants.TraceLogs;
import gcm.netty.queues.batch.BatchGcmMessageQueue;
import gcm.netty.syslog.Statistics;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import io.netty.handler.codec.http.FullHttpResponse;
@cloudbow
cloudbow / gist:9513287
Created Mar 12, 2014
after memory out
View gist:9513287
12:28:01,703 ERROR GcmChannelsPerAppEVG-1-23 util.ResourceLeakDetector:217 - LEAK: ByteBuf.release() was not called before it's garbage-collected.
Recent access records: 2
#2:
Hint: 'ssl' will handle the message from this point.
io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:331)
io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:846)
io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:117)
io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:494)
io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:461)
io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:378)
@cloudbow
cloudbow / gist:9513137
Created Mar 12, 2014
with monotonous loop outside
View gist:9513137
package gcm.netty.codec;
import gcm.netty.config.GcmConfig;
import gcm.netty.syslog.GcmSysLogger;
import gcm.netty.syslog.Statistics;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToMessageEncoder;
import io.netty.handler.codec.http.DefaultFullHttpRequest;
View gist:9513080
package gcm.netty.codec;
import gcm.netty.config.GcmConfig;
import gcm.netty.constants.ErrorConstants;
import gcm.netty.model.BatchFullGcmMessage;
import gcm.netty.syslog.GcmSysLogger;
import gcm.netty.syslog.Statistics;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
@cloudbow
cloudbow / gist:9501934
Created Mar 12, 2014
java.lang.OutOfMemoryError: Direct buffer memory
View gist:9501934
00:05:35,089 WARN GcmChannelsPerAppEVG-1-4 channel.DefaultChannelPipeline:181 - Failed to fail the promise because it's done already: DefaultChannelPromise@3dd47dcb(failure(io.netty.handler.codec.EncoderException: java.lang.OutOfMemoryError: Direct buffer memory)
io.netty.handler.codec.EncoderException: java.lang.OutOfMemoryError: Direct buffer memory
at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:107)
at io.netty.channel.ChannelHandlerInvokerUtil.invokeWriteNow(ChannelHandlerInvokerUtil.java:140)
at io.netty.channel.DefaultChannelHandlerInvoker$WriteTask.run(DefaultChannelHandlerInvoker.java:425)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:318)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:353)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:799)
at java.lang.Thread.run(Thread.java:724)
Caused by: java.lang.OutOfMemoryError: Direct buffer memory
You can’t perform that action at this time.